# Distinct Count based on given criteria

#### harinsh

##### Active Member
Hello,

I am looking some help in getting distinct count by criteria. For example if you refer the below table I brought the distrinct count by using formala {=Sum(1/Countif(A:A,A2))} however, in additon to this need another conditional criteria. If given % different for no then it should consider as 1 count and if more than 1 then it should go for 1/count.

I have mentioned the final require results. can anyone will help on this requirement.

 No % Distinct Count Final Results 1111 60 0.50 1.00 2222 40 0.50 1.00 1111 50 0.50 1.00 3333 10 1.00 1.00 4444 50 1.00 1.00 2222 60 0.50 1.00 5555 50 0.50 0.50 5555 50 0.50 0.50 6666 10 0.33 1.00 6666 60 0.33 1.00 6666 50 0.33 1.00

<colgroup><col style="width:48pt" width="64" span="2"> <col style="mso-width-source:userset;mso-width-alt:3730;width:77pt" width="102"> <col style="mso-width-source:userset;mso-width-alt:3401;width:70pt" width="93"> </colgroup><tbody>
</tbody>

### Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Why SUM?

Last edited:

#### harinsh

##### Active Member
Why SUM?

If I don't use Sum fucntion how do I get the unique number count ? If you see third column in the given table how to get that.

#### SpillerBD

##### Well-known Member
Your Counting the uniques. And then SUMing the uniques. That seems redundant. But the redundancy doesn't show itself because the ARRAY part is evaluated before the SUM function is evoked, so it is only SUMing one value.

Replies
0
Views
183
Replies
12
Views
752
Replies
4
Views
410
Replies
6
Views
617
Replies
4
Views
265

1,127,588
Messages
5,625,668
Members
416,124
Latest member
DeMoNloK

### 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.

### Which adblocker are you using?

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

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