Vlookup - Maybe

RodneyC

Active Member
Joined
Nov 4, 2021
Messages
278
Office Version
  1. 2016
Platform
  1. Windows
I'm trying to use VLOOKUP where if the condition is met, return a value of Y. If it's not met, return a value of N

This produces the Y but produces the #N/A value if the condition is not met. How do I modify my formula so it produces N instead on #N/A?

Thank you in advance
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You could do something like:
Excel Formula:
=IFERROR(VLOOKUP(...),"N")

But I think I could probably use a COUNTIF instead, i.e.
Excel Formula:
=IF(COUNTIF(...)>0,"Y","N")
 
Upvote 0
Solution
You could do something like:
Excel Formula:
=IFERROR(VLOOKUP(...),"N")

But I think I could probably use a COUNTIF instead, i.e.
Excel Formula:
=IF(COUNTIF(...)>0,"Y","N")
YAHTZEE! The first option worked like a charm. Thank you
 
Upvote 0
You are welcome.

The reason I prefer the second option is because the first will ignore ANY error, not just an #N/A error.
So you could ignore other errors that you may want to know about.
 
Upvote 0
Thanks for the follow up. I've entered this

=IF(COUNTIF(B4,InclusionList!$A$2:$E$32,5,FALSE)>0,"Y","N")

and it's telling me "You've entered too many arguments for this function"

There is a shortcoming of the VLOOKUP solution that if we get the COUNTIF working, I'll outline in a separate post.
 
Upvote 0
The COUNTIF function structure is NOT the same as the VLOOKUP strucutre. So you cannot just swap out the two words! You need to put the correct arguments in the correct place.
See: MS Excel: How to use the COUNTIF Function (WS)

So I think your formula will need to look like:
Excel Formula:
=IF(COUNTIF(InclusionList!$A$2:$A$32,B4)>0,"Y","N")
 
Upvote 0
The COUNTIF function structure is NOT the same as the VLOOKUP strucutre. So you cannot just swap out the two words! You need to put the correct arguments in the correct place.
See: MS Excel: How to use the COUNTIF Function (WS)

So I think your formula will need to look like:
Excel Formula:
=IF(COUNTIF(InclusionList!$A$2:$A$32,B4)>0,"Y","N")
That is working perfectly. I'll post the new question in a new post in a couple minutes I appreciate the help
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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