How to count the number of unique date occurrences in a column

Hi!


What's the easiest way to count the total number of unique dates in a single column, as in screenshot?

(I'm not shure, but I believe this is also called "counting distinct".)


I have tried How to count unique text values in numbers - Apple Community but cannot make it work; cannot translate the given formula into text. I keep on getting errors as I paste text in a cell as a formula, whatever I try and change.


A solution without having to add an extra column would be preferable - if possible - for reasons of presentation to others. But this is less important.


Thanks for your effort!

Coen


Mac mini

Posted on Sep 22, 2023 2:09 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 22, 2023 3:51 AM

By far the easiest way is to use a Pivot Table. You get your answer in seconds. No formulas!


Click in the table with the dates, from the menu choose Organize > Create Pivot Table > On Current sheet and drag from the Fields box down to the Rows box as shown.




Click the circled i and switch from Year-Month to Value.



Select the cells in the Pivot Table with the distinct dates and look for COUNTA below.




You can drag that COUNTA token into a cell if you want.


SG

6 replies
Question marked as Top-ranking reply

Sep 22, 2023 3:51 AM in response to CoenX

By far the easiest way is to use a Pivot Table. You get your answer in seconds. No formulas!


Click in the table with the dates, from the menu choose Organize > Create Pivot Table > On Current sheet and drag from the Fields box down to the Rows box as shown.




Click the circled i and switch from Year-Month to Value.



Select the cells in the Pivot Table with the distinct dates and look for COUNTA below.




You can drag that COUNTA token into a cell if you want.


SG

Sep 22, 2023 12:48 PM in response to CoenX

Here is another way. It uses formulas so it updates as soon as you enter new dates. Pivot tables are quick, easy, and powerful but the downside is they need to be refreshed after new data is entered.



Formula in C2 =IFERROR(1÷COUNTIF(B,B),0)

Fill down to complete the column

If you have no empty rows you don't need the IFERROR. It is there to catch division by 0 errors.


Formula in C1 =SUM(C)

This is number of distinct dates

If you put this formula somewhere else you can hide column C





Sep 22, 2023 9:18 AM in response to SGIII

Hi SGIII,


Thanks a lot for your quick answer. I tested in a smaller test version of my actually very large table and it worked! GREAT!


Step #2 didn't show any of the values in your screenshot (it showed just two sort options: name and ascending/descending).


But nevertheless, I did get my COUNTA right and could drag it to a cell of my choice. So I guess step #2 was not essential, at least not for me.


Thanks again for your great help!!!


Coen

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to count the number of unique date occurrences in a column

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.