Countifs using a range for both source and criteria

288enzo

Well-known Member
Joined
Feb 8, 2009
Messages
723
Office Version
  1. 2016
Platform
  1. Windows
Hello, how could I go about using a range for both my source and criteria?

As an example:

My source (dubplicates are only counted as 1, list of completed courses by a user/unique email)
test.xlsx
AB
1Course NumberEmail
2608400email@mymail.com
3608400Bemail@mymail.com
4608400Bemail@mymail.com
5608400Bemail@mymail.com
6608400M2email@mymail.com
7608400M2Bemail@mymail.com
8619152email@mymail.com
9619152Bemail@mymail.com
10619169email@mymail.com
11619169Bemail@mymail.com
12619178email@mymail.com
13619178Bemail@mymail.com
Sheet3

Criteria 1 (list of unique emails)
test.xlsx
AB
1EmailCount
2email@myemail.com
Sheet5
In Range B2 I'm trying to count the number of matches between my source and criteria 2 using the course number.

Criteria 2 (master list of courses)
608400
608400B
608400M2
608400M2B
617256
617256B
619149
619149B
619152
619152B
619155M6
619155M6B
619167M1
619167M1B
619167M2
619167M2B
619169
619169B
619170
619170B
619178
619178B
619303B
718139M1
718139M1B
718139M2
718139M2B

In the above example the match/count would be 9.
test.xlsx
A
1608400
2608400B
3608400M2
4608400M2B
5617256
6617256B
7619149
8619149B
9619152
10619152B
11619155M6
12619155M6B
13619167M1
14619167M1B
15619167M2
16619167M2B
17619169
18619169B
19619170
20619170B
21619178
22619178B
23619303B
24718139M1
25718139M1B
26718139M2
27718139M2B
Sheet2

There will be course codes completed by a user not on the master course list, so I wouldn't be able to count the number of unique completed courses by each unique email. I wish it was that simple. Each completed course needs to match the master list to count as 1.

Thank you!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I think I figured it out. The key was to first remove duplicates. From there I was able to use =SUMPRODUCT(COUNTIFS(emails,email,completed courses,master list of courses))
 
Upvote 0

Forum statistics

Threads
1,215,298
Messages
6,124,116
Members
449,142
Latest member
championbowler

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