Count unique values meeting certain criteria

Shree1

New Member
Joined
Sep 8, 2014
Messages
31
Hi,

I have the below two columns. I want to count the unique names that come up as Priority 3.


I tried =SUMPRODUCT((B2:B5<>"")*(A2:A5="Priority 3")/COUNTIF(B2:B5,B2:B5)). However, it's giving me an incorrect number. Can someone help, please
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Priority[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]Priority 1[/TD]
[TD]Sam[/TD]
[/TR]
[TR]
[TD]Priority 1[/TD]
[TD]Tom[/TD]
[/TR]
[TR]
[TD]Priority 2[/TD]
[TD]Dan[/TD]
[/TR]
[TR]
[TD]Priority 3[/TD]
[TD]Adrian [/TD]
[/TR]
[TR]
[TD]Priority 3[/TD]
[TD]Adrian[/TD]
[/TR]
</TBODY>[/TABLE]
 
Try this array formula
=SUM(IF(FREQUENCY(IF(A2:A6="Priority 3",IF(B2:B6<>"",MATCH(B2:B6,B2:B6,0))),ROW(B2:B6)-ROW(B2)+1),1))

confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.
 
Upvote 0
Actually, it works if I have it on the same worksheet, I had a table in a separate worksheet and was writing the formula there, whilst poiting to the cell references on the original sheet
 
Upvote 0
Actually, it works if I have it on the same worksheet, I had a table in a separate worksheet and was writing the formula there, whilst poiting to the cell references on the original sheet

Adjust the cell references and the formula should work.

M.
 
Upvote 0

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