Function Problems

How to Count Unique Dates for Each Name in Excel

Aamir Naveed AkramAamir Naveed Akram Nov 10, 2026 868 views

Question details

The user needs to calculate the number of distinct dates associated with each specific name within a dataset.

How to Count Unique Dates for Each Name in Excel
Product
Excel
Device & OS
not provided
Scenario
Analyzing a dataset containing names and dates to find how many unique days each person has recorded.
Observed behavior
Requires a method to output a distinct count of dates grouped by name, for example, obtaining a result of 4 unique dates for the name 'Coach'.
Before you start

Ensure your dataset does not contain empty rows within the target range and verify that the date column is formatted properly as Dates rather than plain text.

Solution 1Recommended

Use Dynamic Array Formulas (COUNT, UNIQUE, FILTER)

Combine COUNT, UNIQUE, and FILTER functions to dynamically filter dates by name and count only the distinct values.

This method is highly efficient for modern Excel versions supporting dynamic arrays. It filters the dataset based on the specific name, extracts only the unique dates from that filtered list, and counts them.

1
Select the destination cell

Click on the cell where you want the distinct count result to appear (e.g., cell C2).

2
Enter the nested formula

Assuming your dates are in column A and names are in column B, enter the formula: =COUNT(UNIQUE(FILTER($A$2:$A$781,$B$2:$B$781=B2)))

3
Apply the formula to other rows

Press Enter to get the result. Click the bottom-right corner of cell C2 and drag the fill handle down to apply the calculation to the rest of the names.

Use Dynamic Array Formulas (COUNT, UNIQUE, FILTER)
Formula Accuracy: Using absolute references ($A$2:$A$781) ensures your data range does not shift when dragging the formula down.
WPS Spreadsheet Solution

Easily Count Unique Values with WPS Spreadsheet

WPS Spreadsheet supports advanced array formulas and comprehensive PivotTable functionalities, making it incredibly simple to calculate distinct counts for your data analysis tasks.

  1. 1. Open your data in WPS Spreadsheet: Launch WPS Office and open the workbook containing your names and dates.
  2. 2. Apply the array formula: Select a blank cell and enter =COUNT(UNIQUE(FILTER(A2:A100, B2:B100=B2))) to get your distinct count.
  3. 3. Drag to fill: Use the fill handle to drag the formula down to calculate the unique dates for all remaining names.
Fully compatible with Microsoft Excel formulas like UNIQUE and FILTER.Intuitive PivotTable creation with advanced data summarization options.Free, lightweight, and user-friendly spreadsheet interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my COUNT UNIQUE FILTER formula return a #CALC! or #VALUE! error?

This usually happens if the data ranges inside the FILTER function do not match in size (e.g., comparing rows 2:781 with rows 2:780), or if there is no data matching the criteria. Ensure your row lengths are identical.

Can I count unique dates if the dates are formatted as text?

The formula might still work if the text strings are exact matches. However, to prevent hidden spaces or differing date formats from skewing your counts, it is best to convert the text to actual date values using the VALUE function or the Text to Columns tool.

Where is the 'Distinct Count' option in a standard PivotTable?

'Distinct Count' is not available in standard PivotTables. You must check the 'Add this data to the Data Model' box during the initial creation of the PivotTable to unlock this specific summarization option in the Value Field Settings.