IF statement w/ 2 Vlookups

kal8v9

New Member
Joined
Feb 20, 2009
Messages
9
Hi-

I need help. I have a IF statement and I want 2 vlookups in it. It says this =IF(AB18="Outbound",VLOOKUP(A18,'Shipper Number'!$A$1:$E$17,4,FALSE),VLOOKUP(K3,Plants!$B$1:C$5,2,FALSE)). Well the first vlookup is returning a #N/A. I want the statement to read if the cell reads outbound look at shipper number and return #, but if the shipper number doesn't match look at tab plants and return plant number. The first vlookup is returning a #N/A and it is causing the 2nd vlookup not to work.

Hope that sounds ok, and you can understand it.

Thanks,
Kelly
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

sijpie

Well-known Member
Joined
Nov 1, 2008
Messages
3,734
use a isna() function to check first. so

=IF(AB18="Outbound",IF(ISNA(VLOOKUP(A18,'Shipper Number'!$A$1:$E$17,4,FALSE)),VLOOKUP(K3,Plants!$B$1:C$5,2,FALSE)),VLOOKUP(A18,'Shipper Number'!$A$1:$E$17,4,FALSE))

So now if the first returns #NA it does the second, if it does not return #NA it shows the result
 

Watch MrExcel Video

Forum statistics

Threads
1,129,361
Messages
5,635,808
Members
416,884
Latest member
leeshjay

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
Top