Chris2015
Chris2015

Reputation: 1050

Vlookup of text values

I wanted to know if there was a way to use a vlookup on text values. Normally, I have been converting my text values to a number and then doing a vlookup, but this can be time consuming. For example, if i have a column of numbers (formatted as text) like 100-4333-239 I have been removing the "-" and converting to a number and then doing a vlookup. Is there a way to look up text without all the converting?

Thank you.

Upvotes: 2

Views: 56514

Answers (1)

JohnB
JohnB

Reputation: 13713

The last argument determines whether VLOOKUP should find "approximate" matches as well (which is, in my opinion, a bad description -- passing TRUE there or leaving the argument out seems to tell Excel that the table is sorted). In practice, this means that you should pass FALSE when searching for text:

=VLOOKUP("100-4333-239";B2:C10;2;FALSE)

should give you "THERESULT" if you have "100-4333-239" in cell B4 and "THERESULT" in cell C4:

      A         B          C
1  |     |            |         |
2  |     |999-9999-999|   XX    |
3  |     |999-9999-999|   XX    |
4  |     |100-4333-239|THERESULT|
5  |     |999-9999-999|   XX    |
6  |     |999-9999-999|   XX    |
7  |     |999-9999-999|   XX    |
8  |     |999-9999-999|   XX    |
9  |     |999-9999-999|   XX    |
10 |     |999-9999-999|   XX    |
11 |     |            |         |

Upvotes: 4

Related Questions