Multiple OR Statements

jlkirk

Active Member
Joined
May 6, 2002
Messages
328
Office Version
  1. 365
I know I have seen this somewhere, but can't seem to find it. I have a column of names (B1:B10). What I would like to do is put a formula in C1 that inserts "YES" if three (3) specific names (for example, "John", "Mary", or "Frank") are present in B1:B10, and "NO" if they aren't .
Taks in advance.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Sorry,
If ANY of the three names are present, insert "YES", and if none of the three are present, insert "NO".
Thanks.
 
Upvote 0
Try:

=IF(SUMPRODUCT(--ISNUMBER(MATCH({"John","Mary","Frank"},B1:B10,0))),"Yes","No")
 
Upvote 0
Hi,

To check that all 3 names are present you could use this:
Code:
=IF(SUM(--ISNUMBER(MATCH({"John","Mary","Frank"},B1:B10,0)))=3,"Yes","No")

To check that at least one of the names is present you could use this:
Code:
=IF(SUM(COUNTIF(B1:B10,{"John","Mary","Frank"})),"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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