Combining IF statement with VLOOKUP and two table arrays

G

Gordon

I have a vlookup that returns values from list 1. What I want to do is to
combine that with an IF statement, such that if the lookup criteria is NOT
present in list 1, (ie the VLOOKUP on its own returns #N/A), then a vlookup
is performed on list 2. I've tried using a formula in the format of
IF((vlookup1="#N/A),VLOOKUP2) but that doesn't seem to work. The formula
doesn't seem to recognise "#N/A" .
How can I do this?

Thanks
 
A

Alan Beban

Gordon said:
I have a vlookup that returns values from list 1. What I want to do is to
combine that with an IF statement, such that if the lookup criteria is NOT
present in list 1, (ie the VLOOKUP on its own returns #N/A), then a vlookup
is performed on list 2. I've tried using a formula in the format of
IF((vlookup1="#N/A),VLOOKUP2) but that doesn't seem to work. The formula
doesn't seem to recognise "#N/A" .
How can I do this?

Thanks
IF(NOT(ISNA(VLOOKUP1(...1))),VLOOKUP1(...1),VLOOKUP2(,...2))

Alan Beban
 
G

Gordon

Alan Beban said:
IF(NOT(ISNA(VLOOKUP1(...1))),VLOOKUP1(...1),VLOOKUP2(,...2))

Alan Beban

Thanks, I'll remember that - I actually managed to do it with an IF(COUNTIF
formula which apparently is a bit less hungry on resources as the ISNA
causes Excel to do the vlookup twice, if I understand it correctly.
 

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