Count value in column 2, but if duplicate in column 1 only count once

laraivison

New Member
Joined
Mar 1, 2013
Messages
2
Hi,

I am trying to count how many times the values appear in column 2, but if the corresponding value in column 1 is a duplicate, I only want to count the value in column 2 once.

[TABLE="width: 200"]
<tbody>[TR]
[TD]Unit 1[/TD]
[TD]730[/TD]
[/TR]
[TR]
[TD]Unit 1[/TD]
[TD]730[/TD]
[/TR]
[TR]
[TD]Unit 2[/TD]
[TD]715[/TD]
[/TR]
[TR]
[TD]Unit 3[/TD]
[TD]730[/TD]
[/TR]
[TR]
[TD]Unit 3[/TD]
[TD]730[/TD]
[/TR]
[TR]
[TD]Unit 4[/TD]
[TD]730[/TD]
[/TR]
[TR]
[TD]Unit 5[/TD]
[TD]715[/TD]
[/TR]
[TR]
[TD]Unit 6[/TD]
[TD]715[/TD]
[/TR]
</tbody>[/TABLE]

so for the above data I would hope to get

715 = 3
730 = 3

Thanks in advance!
 
with your data in a1:b9 (including a header row), and 730 and 715 in d2 and d3 respectively:

=SUM(IF(FREQUENCY(IF($B$2:$B$9=D2,MATCH($A$2:$A$9,$A$2:$A$9,0)),ROW($A$2:$A$9)-ROW($A$2)+1),1))

...entered with control + shift + enter, not just enter.
 
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