Vlookup Problem

B

Belinda7237

My Vlookup formula is:

=VLOOKUP(D81,'Week 2 Dataset'!G:O,9,0)

How would I write this differently so that when a result doesnt match i get
the cell to be left blank instead of #NA?

I need to incoprate an if but am not sure how to write it?

Thanks!
 
G

Gary''s Student

=IF(ISERROR(VLOOKUP(D81,'Week 2 Dataset'!G:O,9,0)),"",VLOOKUP(D81,'Week 2
Dataset'!G:O,9,0))
 
T

T. Valko

Another one:

=IF(COUNTIF('Week 2 Dataset'!G:G,D81),VLOOKUP(D81,'Week 2
Dataset'!G:O,9,0),"")

If you're using Excel 2007:

=IFERROR(VLOOKUP(D81,'Week 2 Dataset'!G:O,9,0),"")

Note that this will trap *all* errors, not just #N/A.
 
D

Dave

Hi Biff,
I've seen you do this a couple of times lately - ie use an IF function
without an operator in the criteria. In this case, when the COUNTIF returns
1, the first option is chosen; when it returns 0, the second option is
chosen. Does the IF function just recognize a zero as FALSE, and anything
else as TRUE?.
Regards - Dave.
 
B

Belinda7237

thank you all for your help - in using this formula and copying it down the
column, it seems to work on the items that are NA, however, the items that
have a value instead of returning the looked up value return NA?
 
T

T. Valko

Does the IF function just recognize a zero as FALSE,
and anything else as TRUE?.

Well, not "anything else".

0 is evaluated as FALSE and *any number other than 0* is evaluated as TRUE.

0 = FALSE
1 = TRUE
-1.0255678 = TRUE
0.000000001 = TRUE
100000 = TRUE
TEXT = #VALUE! error
 

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