Case Sensitive Vlookup…
Note:InallExcelversionsotherthanExcel365,thisonlyworksasanarray
formula,soremembertopressCtrl+Shift+Entertocompleteitcorrectly.In
Excel365,duetosupportfordynamicarrays,italsoworksasaregularformula.
How this formula works:
The core part that does the trick is theCHOOSEformula with nested
EXACT:
CHOOSE({1,2}, EXACT(F2, A2:A7), B2:B7)
Here, the EXACT function compares the value in F2 against each value in
A2:A7 and returns TRUE if they are exactly the same including the letter
case, FALSE otherwise:
{FALSE;FALSE;FALSE;TRUE;FALSE;FALSE}
For theindex_numargument of CHOOSE, we use the array constant {1,2}.
As the result, the function combines the logical values from the above
array and the values from C2:C7 into atwo-dimensional arraylike this:
{FALSE,155;FALSE,186;FALSE,90;TRUE,54;FALSE,159;FALSE,28}
The VLOOKUP function takes it from there and searches for the lookup
value (which is TRUE) in the 1st column of the 2-dimensional array
(represented by the logical values) and returns a match from the 2nd
column, which is the price we are looking for:
VLOOKUP(TRUE,
{FALSE,155;FALSE,186;FALSE,90;TRUE,54;FALSE,159;FALSE,28}, 2, 0)