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)
 

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

Back
Top