Inconsistent results with =LOOKUP?

W

watkincm

I am using Lookup across 2 worksheets.
Where lookup finds a match, the result vector seems to work fine (too many
rows to check them all). However, when no match is found, the result vector
either returns a '1' or (in one instance only) a #N/A error.
I would have expected the error rather than the '1' or am I missing something?

The formula in sheet "2005": =LOOKUP($B3,'2004'!B$3:B$9689,'2004'!P$3:p$9689)
Any ideas?
 
S

SiC

Hi Mike,

The LOOKUP function does not usually return #N/A when there's no exact
match. Rather, it goes to the next smallest value in the lookup vector and
returns the corresponding result vector. The only time it returns #N/A is
when your lookup value is smaller than the smallest value in the lookup
vector. You might want to try using VLOOKUP instead, if you want to always
return #N/A when there's no exact match. Hope this helps.

-Simon
 
W

watkincm

Then LOOKUP was working correctly - that's exactly what it did... :)
VLOOKUP works perfectly for what I need - thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top