简体   繁体   中英

VLookup in Excel gives strange results

I know this should be very simple, but something odd is going on with VLookup in Excel. I'm using Excel 2003. I know its ancient. But its what I have.

Heres the scenario

Col A           ColumnB     ColumnC
green            asdf       =VLOOKUP($A1,B1:B4,B:B,TRUE)
blue             ggss       =VLOOKUP($A2,B1:B4,B:B,TRUE) 
orange           green      =VLOOKUP($A3,B1:B4,B:B,TRUE)
red              blue       =VLOOKUP($A4,B1:B4,B:B,TRUE)

I'd expect this to return:

green
blue
#n/a
#n/a

but I get

#REF! on all lines.

I've tried it with TRUE instead of FALSE. Also, with a range name instead of the B1:B4, with the same results.

I must be missing something here. I've tried this in Google Apps and in OpenOffice Calc with similar results. Can someone point me in the right direction?

Don't use the column range "B:B" for the third argument.

It's looking for a number (numeric column number) =VLOOKUP($A1, B1:B4, 1, TRUE)

EDIT: When I replicate your column data as described, I get:

   A    |   B   |    C
green   | asdf  | green
blue    | ggss  | asdf
orange  | green | blue
red     | blue  | blue

You won't achieve your desired results with TRUE as your last argument

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM