We help IT Professionals succeed at work.

# Count Distinct Cells that meet a criteria. - Max Points

on
1,086 Views
Hi All

Been a while since I have been on here.... and have a question for a change...

Consider the data:

Divison                             Style
1 CLOTHING50-250         1000065
1 CLOTHING500-1000         1000065
2 NLA<50                           1000464
2 NLA<50                           1000508
2 NLA<50                           1000518
2 NLA50-250                  1000552
2 NLA<50                           1000552
3 MENSWEAR<50                  1000914
3 MENSWEAR<50                  1000914
2 NLA250-500                  1001012
2 NLA250-500                  1001012

I need to work out the following

A count of all the Distinct Styles - for a given division.

So for example:
1 CLOTHING50-250 - has only one distinct Style - so the result is 1.

2 NLA<50 - has four styles - and they are all distinct - so the result is also 1

2 NLA250-500 - has two styles - but the number of distinct styles is 1

Hopefully this makes sense....

Now I have refreshed my mind on arrays and sumproduct etc etc... so almost have what I want... but not quite....

I have no problem counting the distinct number of styles - =SUMPRODUCT((1/COUNTIF(H5:H15,H5:H15)))

But not then applying the condition on the Division column as well....

JP

Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2008
Commented:
This problem has been solved!
###### Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

Deciding to stick with EE.

Mohamed Asif

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant