Reputation: 926
I had a quick question about VLOOKUP in Excel. Suppose I create a table of three rows and two columns with no headers. Say that I supply the first column with the categories 'bad' 'okay and 'good' and the second with the numbers 0,1,2. If I have a single column somewhere else in the worksheet containing 0s 1s and 2s I understand that my VLOOKUP should look as follows:
VLOOKUP(an entry in the column of 0s 1s and 2s, the table of three rows and two columns, 2, FALSE).
However, I get an N/A value. Does anyone know why this might be?
Upvotes: 0
Views: 351
Reputation: 46361
For VLOOKUP
to work you'd need the table to have the number column to the left of the text column (lookup range is always 1st column of the "table array"), so you either need to switch those and use VLOOKUP or leave the current setup and use INDEX/MATCH
=INDEX(1st column of table,MATCH(an entry in the column of 0s 1s and 2s, 2nd column of table,0))
Upvotes: 2
Reputation: 71558
VLOOKUP
takes the entry (first part of function) and looks in column 1 of the table, that is, in your example, it is looking in the column containing 'Good', 'Okay' and 'Bad' and since it doesn't find anything (0, 1 or 2), it returns #N/A
.
Turn around your table so that 0, 1 and 2 are first and then in the next column have 'Good', 'Okay' and 'Bad' and retype your formula in.
Upvotes: 1