Count based on multiple conditions

braedenbear

New Member
Joined
Jun 7, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I feel like this is a simple question but the solution eludes me.

I'm trying to accomplish 2 things:
  1. Count the total number of people in a region who have:
    1. Completed all the training courses
    2. Completed some of the training courses
    3. Completed none of the training course
  2. Generate a list of people in each of the categories above.
I've played around with a few formulas but have a hard time establishing the "count by unique person" condition. Any help or tips would be appreciated!
 

Attachments

  • Excel example.png
    Excel example.png
    16.8 KB · Views: 11

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
While this isn't as elegant a solution as I would have liked, I believe it returns the results you want to see.

First, I put your sample data in cells A1:D13. In cells J5:M5, I put the description headers. In J6, I used the UNIQUE function to extract a list of unique names.

The formulas I entered in row 6 (and subsequently copied down) were:

J6=UNIQUE(A2:A13)
K6=IF(COUNTIFS($A$2:$A$13,$J6,$C$2:$C$13,"Yes")=3, "Yes","")
L6=IF(AND(COUNTIFS($A$2:$A$13,$J6,$C$2:$C$13,"Yes")>0, COUNTIFS($A$2:$A$13,$J6,$C$2:$C$13,"Yes")<3),"Yes","")
M6=IF(COUNTIFS($A$2:$A$13,$J6,$C$2:$C$13,"Yes")=0, "Yes","")

1686161250746.png


Then, to get the counts, I added Count headers in row 3 and the following formula in cell K4 (dragging it to cell M4):

Excel Formula:
=COUNTIF(K$6:K$9,"Yes")

(Honestly, i had forgotten about the counting portion after working out all the initial calculations :sneaky:)
 
Last edited:
Upvote 0
Solution
@Wookiee this is perfect, much appreciated. I think I was trying to do too much in one go - needed to separate out the unique names first, then build the formulas as you have done above.

Thanks again :)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

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