Search code examples
google-sheetsgoogle-sheets-formulags-vlookup

VLOOKUP returning wrong row


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?


Solution

  • 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!