Nested If Statements with Two Vlookups

rrmando18

New Member
Joined
Sep 13, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Happy almost Friday everyone. I need help. I can't get this to work. It returns either "Lump Sum" or #N/A.

If A18 is found in 'Lump Sum' sheet then return "Lump Sum"

If A18 is found in 'Material' sheet then return "Material"

If A18 is not found in either of those two sheets then return "TS Labor"

=IF(VLOOKUP(A18,'Lump Sum'!B:B,1,FALSE),"Lump Sum",IF(VLOOKUP(A18,Material!B:B,1,FALSE),"Material","TS Labor"))

Thank you!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
When your first VLOOKUP doesn't find the value, it returns #NA! and that ends up voiding the rest of the formula. You could wrap each VLOOKUP in something like this:

ISNA( VLOOKUP() )= FALSE

or replace with XLOOKUP and return a 0 if the value is not found.
 
Upvote 0
Would the below give you what you want?

=IF(ISNA(VLOOKUP(A18,'Lump Sum'!B:B,1,FALSE)),IF(ISNA(VLOOKUP(A18,Material!B:B,1,FALSE)),"TS Labor","Material"),"Lump Sum")
 
Upvote 0
Would the below give you what you want?

=IF(ISNA(VLOOKUP(A18,'Lump Sum'!B:B,1,FALSE)),IF(ISNA(VLOOKUP(A18,Material!B:B,1,FALSE)),"TS Labor","Material"),"Lump Sum")
Yes, thank you. I was trying to get the ISNA or Xlookup to work but wasn't having any luck. Thank you both.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top