Distinct Count

Excel515

New Member
Joined
Mar 16, 2015
Messages
2
So I have multiple month-end dates in a column. I have the below formula which counts the number of distinct dates and that works, but as I add more month-ends throughout the year I keep having to adjust the below formula. I tried doing =SUMPRODUCT(1/COUNTIF(B:B,B:B)) but that seems to break it. So I was just wondering if there is a better way to get that distinct count and make the formula dynamic so to speak? Any help would be much appreciated :)


Example Formula currently: =SUMPRODUCT(1/COUNTIF($B$2:$B$471,$B$2:$B$471))
Column B
1/31/2019
1/31/2019
1/31/2019
2/28/2019
2/28/2019
3/31/2019
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
maybe use Count Distinct in PivotTable with Data Model

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td]date[/td][td][/td][td=bgcolor:#DDEBF7]date[/td][td=bgcolor:#DDEBF7]Distinct Count of date[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
31/01/2019​
[/td][td][/td][td]
31/01/2019​
[/td][td]
1​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
31/01/2019​
[/td][td][/td][td]
28/02/2019​
[/td][td]
1​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
31/01/2019​
[/td][td][/td][td]
31/03/2019​
[/td][td]
1​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
28/02/2019​
[/td][td][/td][td=bgcolor:#DDEBF7]Grand Total[/td][td=bgcolor:#DDEBF7]
3
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
28/02/2019​
[/td][td][/td][td][/td][td][/td][/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

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