Count unique values in one column based on criteria in another column

Robmeister89

New Member
Joined
Sep 5, 2017
Messages
10
So I have the following:
ABCDEFGHIJ
51Team1..................80
52Team2..................95
53Team3..................88
54Team3..................82
55Team2..................84
56Team4..................92
57Team1..................82

<tbody>
</tbody>


Columns A-B and D-I don't matter in this instance so I just put ... in them for the most part. What I need to do is come up with a formula to count the unique values in Column C based on column J being less than 85. So the formula would output 3 unique values (Team1, Team2, and Team3 all have a number less than 85 in column J). Some cells in column J will be empty, not sure if that is going to effect the formula.

Any help with this would be greatly appreciated!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi Robmeister89,

See if this is for you:

In cells: L1, M1, N1, O1 have the names of the teams:
Team1, Team2, Team3, Team4


In the cells: L2, M2, N2, O2 the formula:

=SUM(IF(($C$1:$C$7=L$1)*($J$1:$J$7>0)*($J$1:$J$7<85),1,0))

This is a matricial formula, you need press CTRL+SHIFT+ENTER for run ok?
 
Upvote 0
If you only want to return a unique count, in this case the number 3, try..

=SUM(IF(FREQUENCY(IF(LEN(J1:J7)>0,IF(J1:J7<85,IF(LEN(C1:C7)>0,MATCH(C1:C7,C1:C7,0)))),ROW(C1:C7)-ROW(C1)+1)>0,1))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Last edited:
Upvote 0
If you only want to return a unique count, in this case the number 3, try..

=SUM(IF(FREQUENCY(IF(LEN(J1:J7)>0,IF(J1:J7<85,IF(LEN(C1:C7)>0,MATCH(C1:C7,C1:C7,0)))),ROW(C1:C7)-ROW(C1)+1)>0,1))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!


No words... i'm a baby in this forum...
Thanks for this lesson.
 
Upvote 0
If you only want to return a unique count, in this case the number 3, try..

=SUM(IF(FREQUENCY(IF(LEN(J1:J7)>0,IF(J1:J7<85,IF(LEN(C1:C7)>0,MATCH(C1:C7,C1:C7,0)))),ROW(C1:C7)-ROW(C1)+1)>0,1))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
Thank you, this worked perfectly!
 
Upvote 0
If you only want to return a unique count, in this case the number 3, try..

=SUM(IF(FREQUENCY(IF(LEN(J1:J7)>0,IF(J1:J7<85,IF(LEN(C1:C7)>0,MATCH(C1:C7,C1:C7,0)))),ROW(C1:C7)-ROW(C1)+1)>0,1))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!


Hey Domenic,

This solution worked great for one criterion! How would you go about incorporating a second criterion from another column? For example, if you added a new column "K" and wanted K = "SpecificText" as another criterion.

I attempted to use an AND nested inside of the expression, but couldn't get it to work. I placed the AND like this:

....IF(And(J1:J7<85 , K1:K7 = "SpecificText")...


Could use your expertise! Thanks :)
 
Upvote 0

Forum statistics

Threads
1,216,228
Messages
6,129,611
Members
449,520
Latest member
TBFrieds

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