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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

BenMiller

Well-known Member
Joined
Nov 17, 2011
Messages
1,961
Office Version
  1. 365
Platform
  1. Windows
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")
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,969
Office Version
  1. 365
Platform
  1. Windows
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
 

MattDexx

New Member
Joined
Jan 24, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
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!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,969
Office Version
  1. 365
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,321
Messages
5,641,513
Members
417,213
Latest member
wikk

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
Top