Count number of unique countries per company

D4rwin

Board Regular
Joined
Mar 31, 2014
Messages
91
Hi,

I have a table of unique emails with corresponding company and country.
I want to have a column which counts the number of unique countries a company is active in.

Column D is where I want the count to be in. Can someone help me with a formula for this?

EmailCompanyCountry#Countries
xxxAFrance3
xxxAGermany3
xxxAUK3
xxxBFrance1
xxxBFrance1
xxxCGermany2
xxxCUK2

<tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
In D2 control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF(1-($C$2:$C$8=""),IF($A$2:$A$8=$A2,MATCH($C$2:$C$8,$C$2:$C$8,0))),ROW($C$2:$C$8)-ROW($C$2)+1),1))
 
Upvote 0

Book1
ABCD
1EmailCompanyCountry#Countries
2xxxAFrance3
3xxxAGermany3
4xxxAUK3
5xxxBFrance1
6xxxBFrance1
7xxxCGermany2
8xxxCUK2
Sheet1
Cell Formulas
RangeFormula
D2{=SUM(--(FREQUENCY(IF($B$2:$B$8=$B2,MATCH($C$2:$C$8,$C$2:$C$8,0)),ROW($C$2:$C$8)-ROW($C$2)+1)>0))}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0
Thanks for the responses. Should have specified that I am allergic to array formulas.
Any other nifty way using sumproduct perhaps?
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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