Explanation

In this example, the goal is to perform a case-sensitive lookup on Color with VLOOKUP.

This presents several challenges.

First, Excel isnotcase-sensitive by default, and there is no built-in setting to make VLOOKUP case-sensitive.

The array created by the CHOOSE function

The correct result is 10.

The second challenge is the table itself.

Unlike XLOOKUP or INDEX and MATCH, VLOOKUPrequiresthe entire table to be provided in thetable_arrayargument.

The array created by the CHOOSE function

Normally, this is not a problem.

The overall process looks like this:

The result is a case-sensitive lookup with VLOOKUP.

Read on for a complete explanation.

The array created by the CHOOSE function

Background reading

This article assumes you are familiar with the VLOOKUP function and Excel Tables.

If the two values match exactly, EXACT returns TRUE.

If not, EXACT returns FALSE.

The array created by the CHOOSE function

Fortunately, the EXACT function will do this.

EXACT returns FALSE for every other value, including “Red” in row 3.

This gives us an array we can use in the next step.

The array created by the CHOOSE function

In addition, the first column in the table must contain lookup values.

What we need is anewtable, that combines the result from EXACT with the values in the Qty column.

Normally, the CHOOSE function is used to select a value by numeric position.

Excel formula: INDEX and MATCH case-sensitive

We now have a table we can use in VLOOKUP.

VLOOKUP function

Next, we need to connect the code above to theVLOOKUP function.

Because the values we want to retrieve are in the second column, we setcol_index_numto 2.

Excel formula: XLOOKUP case-sensitive

Then we set therange_lookupargument to zero or FALSE, to enable an exact match.

The values provided to CHOOSE can include references.

Excel formula: Case sensitive lookup

Excel VLOOKUP function

Excel EXACT function

Excel CHOOSE function