Excel failing at String VLOOKUP

后端 未结 2 981
自闭症患者
自闭症患者 2021-02-12 19:22

I have a table that looks like this

   B   C
43 XS  6
44 S   11
45 M   16
46 L   21
47 XL  26
48 XXL 31

I\'ve written the formula:



        
2条回答
  •  温柔的废话
    2021-02-12 20:06

    VLOOKUP does strange things unless you specify an "exact match" with the fourth argument, like so:

    =VLOOKUP("S",B43:C48,2,FALSE)
    

    From Excel's help file:

    VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

    If range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted.

    And also:

    range_lookup is a logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, VLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.

提交回复
热议问题