Countif Multiple Criteria Met in Same Row

MattDexx

New Member
Joined
Jan 24, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I'd greatly appreciate your help solving this issue. I'm running Excel 2012 on MS 365

I have a large data set pulled from a registration system that includes, among other things, separate columns for last names and first names of those who have registered. On a different tab, I've hand-coded in a small number of specific names (with last names and corresponding first names in separate columns) with a third column that would indicate either "yes" or "no" (yes indicating that they have registered and no indicating that they haven't).

I've done a two criteria Countif, but I've realized that it replies "yes" if either the last name or the first name appears in the registration data. For example, if I'm trying to determine if Smith John has registered, the Countif will produce a "yes" if a Smith Eric and a Gonzalez John have registered even if a Smith John hasn't. I need it to only reply "yes" if it meets the criteria of Smith John on the same row of the data set.

Any help would be tremendously appreciated. THANK YOU!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
With your raw data on Sheet1, last name in column A and first name in B - and on Sheet 2 it's the same setup, try this:

=IF(SUMPRODUCT((Sheet1!A:A=A1)*(Sheet1!B:B=B1))=0,"No","Yes")
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about like
Excel Formula:
=IF(COUNTIFS(A:A,F2,B:B,G2),"yes","No")
where F2 & G2 hold the names
 
Upvote 0
With your raw data on Sheet1, last name in column A and first name in B - and on Sheet 2 it's the same setup, try this:

=IF(SUMPRODUCT((Sheet1!A:A=A1)*(Sheet1!B:B=B1))=0,"No","Yes")
Huge thank you!! Both worked. Really appreciate how quickly you responded!
 
Upvote 0
Glad we could help & thanks for the feedback.

I would recommend against using whole column references with sumproduct, as it can slow your workbook down considerably.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,211
Members
448,554
Latest member
Gleisner2

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