Excel Vlookup returns NA with numbers

2020-05-09 22:54发布

I have a table in Excel which contains 2 columns of text, and two columns of numbers. The numbers refer to the position in which a search string is found within a body of text - and if they aren't found then the cell is left empty (eg ISERROR(myfunctions(),""). A screenshot is here (I dont have enough rep to embed a screenshot...)

enter image description here

I wish to return the value in the first column where the minimum and maximum values are from both of the number columns. This to me is simple:

=VLOOKUP(MIN(E3:E7),C3:E7,1)

=VLOOKUP(MAX(E3:E7),C3:E7,1)

This evaluates to #N/A no matter what I try. What is the reason for this?

2条回答
神经病院院长
2楼-- · 2020-05-09 23:09

cut and paste column e to column c. afterwards it should be column c = location, d = weather, e = icon. note, vlookup will display the first value found, top down. So since you have 3 "100000" it is returning C3 first as the MAX value.

min weather formula: =IFERROR(VLOOKUP(MIN($C$3:$C$7),$C$3:$E$7,2,FALSE),"")

max weather formula: =IFERROR(VLOOKUP(MAX($C$3:$C$7),$C$3:$E$7,2,FALSE),"")

enter image description here

查看更多
闹够了就滚
3楼-- · 2020-05-09 23:23

VLOOKUP always does the lookup on the first column in the lookup table so you are looking up the Min value in the weather column and it does not match.

You can either restructure your data so that the location column is first or use INDEX MATCH

=INDEX(C3:E7,MATCH(MIN(E3:E7),E3:E7,0),1)
查看更多
登录 后发表回答