ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Nested if statements (https://www.excelbanter.com/excel-worksheet-functions/223382-nested-if-statements.html)

JBS

Nested if statements
 
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


Luke M

Nested if statements
 
=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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"JBS" wrote:

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


T. Valko

Nested if statements
 
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)

--
Biff
Microsoft Excel MVP


"Luke M" wrote in message
...
=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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"JBS" wrote:

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





All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com