Nesting VLOOKUP Within and IF

Blakerid

New Member
Joined
Oct 27, 2014
Messages
11
Hello,

I am trying to Nest an Vlookup within and IF statement to return a "YES" if the value is in another table. I would also like it to return "NO" if the value is not in the table.

With the formula I have now it will pull the "YES" if the value is in the table but it will not pull the "NO" if the data isn't present.
Instead of "NO" it keeps giving me an #NA error.

Any help is appreciated.

Here is the formula I have been using.

=IF(A2=VLOOKUP(SHEET1!A$2,SHEET2!C$2:C$48,1,FALSE),"YES","NO")

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi Blakerid,

Does this do it?

Code:
=IF(ISNA(VLOOKUP(Sheet1!A$2,Sheet2!C$2:C$48,1,FALSE)),"No","Yes")

Regards,
Howard
 
Upvote 0
Would there be a way to Pull the original Vlookup data and then return a "No" if the data was not in the table?
 
Upvote 0
Hmmm, like this?


Code:
=IF(ISNA(VLOOKUP(Sheet1!A$2,Sheet2!C$2:C$48,1,FALSE)),"No"&" "&A2,"Yes")

Howard
 
Upvote 0
Material
Future Req
Prev. Comments
XXX
Yes
In blocked stock
YYY
No
New
ZZZ
No
New

<tbody>
</tbody>








Howard,

Here is the spreadsheet I am working with.
I used the first formula in the Future Req. The Yes and No work for that one.

Now I am trying to pull comments from an older spreadsheet in Prev Comments.
I would like to return the old comments from another table and if the part is not in the other table I am pulling from have it return a text field like "Not in Table" or "New".

Your Formula just returns the part number.

Hope this makes sense.


Thanks,

Blake
 
Last edited:
Upvote 0
Howard,

I realized I was making this more complicated than it needed to be.
All I needed to do for the second formula was us an
Code:
=IFERROR(VLOOKUP),"NEW")
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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