by Svetlana Cheusheva, updated on
The tutorial explains the syntax and basic uses of the CHOOSE function and provides a few non-trivial examples showing how to use a CHOOSE formula in Excel.
CHOOSE is one of those Excel functions that may not look useful on their own, but combined with other functions give a number of awesome benefits. At the most basic level, you use the CHOOSE function to get a value from a list by specifying the position of that value. Further on in this tutorial, you will find several advanced uses that are certainly worth exploring.
The CHOOSE function in Excel is designed to return a value from the list based on a specified position.
The function is available in Excel 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, and Excel 2007.
The syntax of the CHOOSE function is as follows:
Where:
Index_num (required) - the position of the value to return. It can be any number between 1 and 254, a cell reference, or another formula.
Value1, value2, … - a list of up to 254 values from which to choose. Value1 is required, other values are optional. These can be numbers, text values, cell references, formulas, or defined names.
Here's an example of a CHOOSE formula in the simplest form:
=CHOOSE(3, "Mike", "Sally", "Amy", "Neal")
The formula returns "Amy" because index_num is 3 and "Amy" is the 3rd value in the list:
CHOOSE is a very plain function and you will hardly run into any difficulties implementing it in your worksheets. If the result returned by your CHOOSE formula is unexpected or not the result you were looking for, it may be because of the following reasons:
The following examples show how CHOOSE can extend the capabilities of other Excel functions and provide alternative solutions to some common tasks, even to those that are considered unfeasible by many.
One of the most frequent tasks in Excel is to return different values based on a specified condition. In most cases, this can be done by using a classic nested IF statement. But the CHOOSE function can be a quick and easy-to-understand alternative.
Supposing you have a column of student scores and you want to label the scores based on the following conditions:
Result | Score |
Poor | 0 - 50 |
Satisfactory | 51 - 100 |
Good | 101 - 150 |
Excellent | over 151 |
One way to do this is to nest a few IF formulas inside each other:
=IF(B2>=151, "Excellent", IF(B2>=101, "Good", IF(B2>=51, "Satisfactory", "Poor")))
Another way is to choose a label corresponding to the condition:
=CHOOSE((B2>0) + (B2>=51) + (B2>=101) + (B2>=151), "Poor", "Satisfactory", "Good", "Excellent")
How this formula works:
In the index_num argument, you evaluate each condition and return TRUE if the condition is met, FALSE otherwise. For example, the value in cell B2 meets the first three conditions, so we get this intermediate result:
=CHOOSE(TRUE + TRUE + TRUE + FALSE, "Poor", "Satisfactory", "Good", "Excellent")
Given that in most Excel formulas TRUE equates to 1 and FALSE to 0, our formula undergoes this transformation:
=CHOOSE(1 + 1 + 1 + 0, "Poor", "Satisfactory", "Good", "Excellent")
After the addition operation is performed, we have:
=CHOOSE(3, "Poor", "Satisfactory", "Good", "Excellent")
As the result, the 3rd value in the list is returned, which is "Good".
Tips:
=CHOOSE((B2>0) + (B2>=51) + (B2>=101) + (B2>=151), $E$1, $E$2, $E$3, $E$4)
=IFERROR(CHOOSE((B2>0) + (B2>=51) + (B2>=101) + (B2>=151), "Poor", "Satisfactory", "Good", "Excellent"), "")
In a similar fashion, you can use the Excel CHOOSE function to perform one calculation in a series of possible calculations/formulas without nesting multiple IF statements inside each other.
As an example, let's calculate the commission of each seller depending on their sales:
Commission | Sales |
5% | $0 to $50 |
7% | $51 to $100 |
10% | over $101 |
With the sales amount in B2, the formula takes the following shape:
=CHOOSE((B2>0) + (B2>=51) + (B2>=101), B2*5%, B2*7%, B2*10%)
Instead of hardcoding the percentages in the formula, you can refer to the corresponding cell in your reference table, if there is any. Just remember to fix the references using the $ sign.
=CHOOSE((B2>0) + (B2>=51) + (B2>=101), B2*$E$2, B2*$E$3, B2*$E$4)
As you probably know, Microsoft Excel has a special function to generate random integers between the bottom and top numbers that you specify - RANDBETWEEN function. Nest it in the index_num argument of CHOOSE, and your formula will generate almost any random data you want.
For example, this formula can produce a list of random exam results:
=CHOOSE(RANDBETWEEN(1,4), "Poor", "Satisfactory", "Good", "Excellent")
The formula's logic is obvious: RANDBETWEEN generates random numbers from 1 to 4 and CHOOSE returns a corresponding value from the predefined list of four values.
Note. RANDBETWEEN is a volatile function and it recalculates with every change you make to the worksheet. As the result, your list of random values will also change. To prevent this from happening, you can replace formulas with their values by using the Paste Special feature.
If you have ever performed a vertical lookup in Excel, you know that the VLOOKUP function can only search in the left-most column. In situations when you need to return a value to the left of the lookup column, you can either use the INDEX / MATCH combination or trick VLOOKUP by nesting the CHOOSE function into it. Here's how:
Supposing you have a list of scores in column A, student names in column B, and you want to retrieve a score of a particular student. Since the return column is to the left of the lookup column, a regular Vlookup formula returns the #N/A error:
To fix this, get the CHOOSE function to swap the positions of columns, telling Excel that column 1 is B and column 2 is A:
=CHOOSE({1,2}, B2:B5, A2:A5)
Because we supply an array of {1,2} in the index_num argument, the CHOOSE function accepts ranges in the value arguments (normally, it doesn't).
Now, embed the above formula into the table_array argument of VLOOKUP:
=VLOOKUP(E1,CHOOSE({1,2}, B2:B5, A2:A5),2,FALSE)
And voilà - a lookup to the left is performed without a hitch!
If you are not sure whether you should go to work tomorrow or can stay at home and enjoy your well-deserved weekend, the Excel CHOOSE function can find out when the next work day is.
Assuming your working days are Monday to Friday, the formula goes as follows:
=TODAY()+CHOOSE(WEEKDAY(TODAY()),1,1,1,1,1,3,2)
Tricky at first sight, upon a closer look the formula's logic is easy to follow:
WEEKDAY(TODAY()) returns a serial number corresponding to today's date, ranging from 1 (Sunday) to 7 (Saturday). This number goes to the index_num argument of our CHOOSE formula.
Value1 - value7 (1,1,1,1,1,3,2) determine how many days to add to the current date. If today is Sunday - Thursday (index_num 1 - 5), you add 1 to return the next day. If today is Friday (index_num 6), you add 3 to return next Monday. If today is Saturday (index_num 7), you add 2 to return next Monday again. Yep, it's that simple :)
In situations when you want to get a day name in the standard format such as full name (Monday, Tuesday, etc.) or short name (Mon, Tue, etc.), you can use the TEXT function as explained in this example: Get day of week from date in Excel.
If you wish to return a day of the week or a month name in a custom format, use the CHOOSE function in the following way.
To get a day of the week:
=CHOOSE(WEEKDAY(A2),"Su","Mo","Tu","We","Th","Fr","Sa")
To get a month:
=CHOOSE(MONTH(A2), "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
Where A2 is the cell containing the original date.
I hope this tutorial has given you some ideas of how you can use the CHOOSE function in Excel to enhance your data models. I thank you for reading and hope to see you on our blog next week!
Table of contents