Nested if statements

  • Thread starter Thread starter JBS
  • Start date Start date
J

JBS

I want to do the following

vlookup values from worksheet a in worksheet b and return results to cell 1
if no result from vlookup then lookup value from worksheet a in worksheet c
and return value to cell 1
 
=IF(ISERROR(VLOOKUP('Sheet a'!A2,'Sheet b'!A2:D100,2,FALSE)),VLOOKUP('Sheet
a'!A2,'Sheet c'!A2:D100,2,FALSE),('Sheet a'!A2,'Sheet b'!A2:D100,2,FALSE))

Note that as you'll need to adjust ranges and column callout in the VLOOKUPs
as necessary.
 
Assuming the lookup value is on one sheet or the other:

A1 = lookup value

=VLOOKUP(A1,IF(COUNTIF(Sheet2!A1:A5,A1),Sheet2!A1:B5,Sheet3!A1:B5),2,0)
 
Back
Top