How to Count Unique Dates in Excel (With Examples)


You can use the following formulas to count unique dates in Excel:

Method 1: Count Unique Dates

=COUNT(UNIQUE(B2:B11))

This particular formula counts the number of unique dates in the range B2:B11.

Method 2: Count Unique Dates with Criteria

=SUM(--(LEN(UNIQUE(FILTER(B2:B11,A2:A11="B","")))>0))

This particular formula counts the number of unique dates in the range B2:B11 where the corresponding value in the range A2:A11 is “B.”

The following examples show how to use each formula in practice with the following dataset in Excel that shows the number of sales made on various dates by two different retail stores:

Example 1: Count Unique Dates in Excel

Suppose we would like to count the number of unique dates in the Date column of our dataset.

We can type the following formula into cell E2 to do so:

=COUNT(UNIQUE(B2:B11)) 

The following screenshot shows how to use this formula in practice:

Excel count unique dates

The output tells us that there are 6 unique dates in column B.

Example 2: Count Unique Dates with Criteria in Excel

Suppose we would like to count the number of unique dates in the Date column only for the rows where the Store column is equal to “B.”

We can type the following formula into cell E2 to do so:

=SUM(--(LEN(UNIQUE(FILTER(B2:B11,A2:A11="B","")))>0))

The following screenshot shows how to use this formula in practice:

The output tells us that there are 3 unique dates for Store B.

We can manually identify these three unique dates:

  • 1/6/2024
  • 1/7/2024
  • 1/8/2024

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

Excel: How to Count If Cells Contain Text
Excel: How to Count Unique Values by Group
Excel: How to Count Unique Values Based on Multiple Criteria

Leave a Reply

Your email address will not be published. Required fields are marked *