# IF statement w/ 2 Vlookups

#### kal8v9

##### New Member
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
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

Replies
5
Views
284
Replies
6
Views
172
Replies
3
Views
202
Replies
3
Views
210
Replies
5
Views
150

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.

### Which adblocker are you using?

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

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