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!

:eek:
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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!

:eek:

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,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

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