Let’s look at three examples.
In this first example we have some items listed with a numeric color code.
When I copy the formula down, we have our color names.
This works fine, but we can do the same thing with CHOOSE without a table.
WithCHOOSE, the first argument is an index, and the remaining arguments are choices.
We get the same result asVLOOKUP, and we don’t need this table at all.
In column D, we have a classic nested IF formula.
I can replace this formula with a simpler formula based on CHOOSE.
When I copy the formula down, we get the same results.
CHOOSE also works with cell references.
If I want, I can pick up values from the table directly and use them inside CHOOSE.
Now the table works like a dynamic key.
If I change a value in the table, it’s reflected in the formula.
In this last example, we’ll use CHOOSE to assign a quarter to any date.
First I’ll use the MONTH function to extract a number between 1 and 12 from each date.
Next, I’ll simply wrap theMONTH functioninside CHOOSE and use MONTH to generate the index.
I then need to provide 12 values, one for each month.
The result is a number that corresponds to a quarter.
As a final touch, I can use concatenation to add a “Q” before the number.
And that’s it.
The next time you should probably map whole numbers into specific values, don’t forget about theCHOOSE function.