In Google Sheets, I am having trouble with a VLOOKUP function.
rangeargumentA2:Bcontains text strings.search_keyis in column C, example,C2indexargument is (column)2, which is equivalent toB2:B
Current Formula
- I thought my syntax was correct, but my VLOOKUP formula returns the wrong value.
- In column A are the textual search keys and in column B are the values that I wish to return. Values are sorted.
- Note that
#value!in IFNA is intentional. I want to use the results in a TOCOL function and it was not treating""as a blank ("ignore blanks") so I replaced""with#value!and used "ignore error" instead.
=ifna(vlookup($C2,$A$2:$B,2),#value!)Sample Data
B2:Bstrings are actually 50 characters in length (not 10); they've been shortened below to save space
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | search_key | list of values | user_input | current formula | desired result |
| 2 | mm | 1101000000 | mm | 0100000000 | 1101000000 |
| 3 | mɱ | 1100000000 | #VALUE! | ||
| 4 | mn | 1100001000 | mn | 0100000000 | 1100001000 |
| 5 | mɳ | 1100000010 | #VALUE! | ||
| 6 | ʙʛ | 0100000000 | #VALUE! |