Combining IF statement with VLOOKUP and two table arrays

  • Thread starter Thread starter Gordon
  • Start date Start date
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
 
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
 
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.
 
Back
Top