By Default VLOOKUP
does approximate matches. @Pnuts explained that the desired result is not being returned in every case because the the search is binary.
Excels optional parameter for VLOOKUP
is called range_lookup and quote:
range_lookup Optional. A logical value that specifies whether you
want VLOOKUP to find an exact match or an approximate match:
If range_lookup is either TRUE or is omitted, an exact or approximate
match is returned. If an exact match is not found, the next largest
value that is less than lookup_value is returned.
IMPORTANT If range_lookup is either TRUE or is omitted, the values
in the first column of table_array must be placed in ascending sort
order; otherwise, VLOOKUP might not return the correct value.
For more information, see Sort data in a range or table.
If range_lookup is FALSE, the values in the first column of
table_array do not need to be sorted.
If the range_lookup argument is FALSE, VLOOKUP will find only an exact
match. If there are two or more values in the first column of
table_array that match the lookup_value, the first value found is
used. If an exact match is not found, the error value #N/A is
returned.
Google's optional parameter for VLOOKUP
is called is_sorted and quote:
is_sorted - [OPTIONAL - TRUE by default] - Indicates whether the
column to be searched (the first column of the specified range) is
sorted.
If is_sorted is TRUE or omitted, the nearest match (less than or equal
to the search key) is returned. If all values in the search column are
greater than the search key, #N/A is returned.
If is_sorted is set to TRUE or omitted, and the first column of the
range is not in sorted order, an incorrect value might be returned.
If is_sorted is FALSE, only 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.
If you need exact matching with VLOOKUP
just add FALSE
in the optional parameter to force the lookup of exact matching. If you are using the MATCH
then add a 0.
So the formulas for your spreadsheet should look like:
=VLOOKUP(A2,A1:E13,5,FALSE)
=VLOOKUP("n1-standard-2",A1:E13,5,FALSE)
=MATCH(A2,A1:A13,0)
=MATCH("n1-standard-2",A1:A13,0)
=HLOOKUP(A1,A1:E13,5,FALSE)
=HLOOKUP("n1-standard-1",A1:E13,5,FALSE)