This sounds like the sort of problems for which actual databases exist
But I still can't see how your problem hasn't already been answered - maybe I need to be more explicit.
Here is an example that allocates either 100 or 1000000 or 20000 for data to be held in field[2]: