4

I have a fairly simple lookup table:

enter image description here

The formula I have in B6 is:

=VLOOKUP(A6,C1:D4,2)

So I would expect it to return 1, not 4?

player0
  • 124,011
  • 12
  • 67
  • 124
Bill
  • 3,584
  • 5
  • 35
  • 47

3 Answers3

10

You are omitting the sorted flag, which then defaults to TRUE thus making it ignore the exact match.

Quoting Google Help:

It’s recommended to set is_sorted to FALSE. If set to FALSE, an exact match is returned. If there are multiple matching values, the content of the cell corresponding to the first value found is returned, and #N/A is returned if no such value is found.

Check this image out:

enter image description here

Hope that helps, cheers!

delimiter
  • 745
  • 4
  • 13
1

you miss the 4th vlookup parameter. use this:

=VLOOKUP(A6, C1:D4, 2, 0)

or:

=VLOOKUP(A6, C1:D4, 2, ) 

or:

=VLOOKUP(A6, C1:D4, 2, FALSE)

to get exact match

player0
  • 124,011
  • 12
  • 67
  • 124
0
VLOOKUP(search_key, range, index, [is_sorted])

Where

is_sorted - [optional]

Indicates whether the column to be searched (the first column of the 
   specified range) is sorted, in which case the closest match for 
   search_key will be returned.

so

=VLOOKUP(A6,C1:D4,2) ==> will give you 4, because is_sorted=1, sorted of the              
                         column that to be search. If you change A6=Monthly,
                         it will give you 2

to give you as is, no sorted, so you assign the is_sorted to 0

=VLOOKUP(A6,C1:D4,2,0)
user11982798
  • 1,878
  • 1
  • 6
  • 8