Match two columns in one formula

randolphoralph

Board Regular
Joined
Dec 24, 2008
Messages
126
I have defined a name range and titled it "Data" and trying to match B2 or C2 against the values in the name range "Data"

For example...

The formula should return "Yes" when

B2 does match value in "Data", but C2 does not

B2 does not match value in "Data", but C2 does

B2 and C2 both match

The formula should return "No" when

neither B2 and C2 have matching values in "Data"

Here is what I have so far, but I am not sure how to change the formula to include the 2nd match for C2.

Code:
=IF(ISERROR(MATCH(B2,Data,0)),"No","Yes")
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I have defined a name range and titled it "Data" and trying to match B2 or C2 against the values in the name range "Data"

For example...

The formula should return "Yes" when

B2 does match value in "Data", but C2 does not

B2 does not match value in "Data", but C2 does

B2 and C2 both match

The formula should return "No" when

neither B2 and C2 have matching values in "Data"

Here is what I have so far, but I am not sure how to change the formula to include the 2nd match for C2.

Code:
=IF(ISERROR(MATCH(B2,Data,0)),"No","Yes")
What is the actual range address for "Data"?
 
Upvote 0
T. Valko....the actual range address is Sheet1 A1:A780
OK, here are a couple of other ways...

=IF(SUMPRODUCT(COUNTIF(Data,B2:C2)),"Yes","No")

This one needs to be array entered**:

=IF(COUNT(MATCH(Data,B2:C2,0)),"Yes","No")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,722
Members
452,939
Latest member
WCrawford

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