Removing #N/A from result of two IF statements and a Vlookup

chrisdeleon

New Member
Joined
Sep 28, 2016
Messages
6
Hi all,

I am trying to remove/leave blank the #N/A result of a formula containing two nested IF statements and a Vlookup. The current formula is:

=IF(A2<>"",IF(A2<>"JOHNSMITH",VLOOKUP(A2,'Sheet1'!$A$2:$AH$143152,34,FALSE),""),"")

I've tried placing an IFERROR before the entire formula as well as placing an ISNA before the Vlookup but neither approach works for me.

I really just want the result of the formula to return a blank cell.

Thanks for any help you can provide!!!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Without caffeine:

Code:
=IF(ISNA(IF(A2<>"",IF(A2<>"JOHNSMITH",VLOOKUP(A2,'Sheet1'!$A$2:$AH$143152,34,FALSE),""),"")))

Does this do the trick?
 
Upvote 0
Is JOHNSMITH in the lookup table? Is he being disregarded for a special reason? If he is not on the table... You can do away with your if statements all together as the blank A2 cell will be caught by IFERROR...

=IFERROR(VLOOKUP(A2,Sheet1!$A$2:$AH$143152,34,FALSE), "")

if JOHNSMITH is on your table but you do not want his Vlookup result shown you'll need one IF statement.


=IFERROR(IF(A2="JOHNSMITH","",VLOOKUP(A2,Sheet1!$A$2:$AH$143152,34,FALSE)), "")
 
Upvote 0
Hi RedBeard,

Sadly it did not work.

What I am trying to do is:
- compare two different lists of user IDs. List A has user IDs only. List B has user IDs- some are mentioned in List A, some are not- AND info about these users.
- enter the above formula into List A that first checks whether the cell is blank, hence the IF(A2<>"")
-if A2 is not blank, it then checks whether user JOHNSMITH is also not in the list, hence the IF(A2<>"JOHNSMITH")
-next, if both of these conditions are satisfied, then the formula does a Vlookup to identify the common users in Lists A and B and populates info about these users:

The only problem is that the formula returns #N/A for cells that do not have common user IDs and this needs to be blank.

Really appreciate any help you can give!
 
Upvote 0
Hi tygrrboi,

Yes JOHNSMITH is in the lookup table and needs to be disregarded. Tried your second formula but it did not work. Here is some context of what I'm trying to do.

- compare two different lists of user IDs. List A has user IDs only. List B has user IDs- some are mentioned in List A, some are not- AND info about these users.
- enter the above formula into List A that first checks whether the cell is blank, hence the IF(A2<>"")
-if A2 is not blank, it then checks whether user JOHNSMITH is also not in the list, hence the IF(A2<>"JOHNSMITH")
-next, if both of these conditions are satisfied, then the formula does a Vlookup to identify the common users in Lists A and B and populates info about these users:

The only problem is that the formula returns #N/A for cells that do not have common user IDs and this needs to be blank.

Really appreciate any help you can give!
 
Upvote 0
I do not think I understand. The example formula you gave is only looking at one list... How does the second list factor in?
 
Upvote 0
=IF(OR(A2="",A2="JOHNSMITH"),"",IFERROR(T(VLOOKUP(A2,Sheet1!$A$2:$AH$143152,34,0)),""))

This is built on the assumption that VLOOKUP is expected to return a text value if successful.
 
Upvote 0
Thank you Aladin Akyurek! I was just looking solution you provided on another topic and it worked! I used:

=IF(A2<>"",IF(A2<>"JOHNSMITH",IF(ISNA(VLOOKUP(A2,Sheet1!$A$2:$AH$143152,34,FALSE)),"",VLOOKUP(A2,Sheet1!$A$2:$AH$143152,34,FALSE)),"","")

Does this make sense?

:)
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,933
Members
449,195
Latest member
Stevenciu

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