Distinct Count

hakuna

New Member
Joined
Sep 2, 2012
Messages
33
Hi seniors!

I have a big excel file with alot of data in it. area where i need help will be in counting the distinct number of project numbers. as in, if there are more than 2 cases where the project numbers are same, then i should count them as 1 and not separately.

please help!

:eeek:
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi

This is a well known array formula to count unique elements in a list.
=SUM(1/COUNTIF(A2:A10,A1:A10))
It's an array formula so hit Ctrl+Shift+Enter to confirm the formula.
Change the range (A1:A10) to suit your needs.

Vidar
 
Upvote 0
Hi seniors!

I have a big excel file with alot of data in it. area where i need help will be in counting the distinct number of project numbers. as in, if there are more than 2 cases where the project numbers are same, then i should count them as 1 and not separately.

please help!

:eeek:

Let A2:A1000 house project numbers/ids.

Control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$2:$A$1000<>"",
  MATCH("~"&$A$2:$A$1000,$A$2:$A$1000&"",0)),
   ROW($A$2:$A$1000)-ROW($A$2)+1),1))
If you are certain that there are no spacila meaning chars like < surrounding the target entries, the "~"& and &"" bits can be removed from the above formula.
 
Upvote 0
If the project numbers are numeric and in 1 column say A1:A1000 Then
=SUM((FREQUENCY(A1:A1000,A1:A1000)>0)*1)

However, if they are alpha numeric then above formula won't work so use:
=SUM((FREQUENCY(MATCH(A1:A1000,A1:A1000,0),MATCH(A1:A1000,A1:A1000,0))>0)*1)
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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