How to Count Unique Attendees by Month and Activity in Excel
Question details
The user needs to calculate the number of unique participants and their attendance frequency categorized by month, activity, and email address using Excel formulas.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Tracking event attendance and calculating distinct participant metrics across multiple categories (month, event, email).
- Observed behavior
- Needs a streamlined way to extract unique combinations and summarize attendance data, typically requiring modern dynamic array functions or advanced pivot tables.
Ensure you are using a compatible version of Microsoft 365, as modern dynamic array functions like UNIQUE, HSTACK, and PIVOTBY may not be available in older Excel versions.
Use Dynamic Array Functions (UNIQUE, HSTACK, PIVOTBY)
Utilize the latest Excel 365 functions to dynamically extract and summarize unique attendance records.
This method uses the LET function to define variables, UNIQUE and HSTACK to find distinct combinations of month, event, and email, and PIVOTBY to aggregate the counts automatically.
Note that PIVOTBY is a relatively new function and might currently be available only to Microsoft 365 Insiders. If it is unavailable, consider using the second solution.
Click on an empty cell where you want the summarized unique attendance data to appear.
Combine the criteria columns horizontally and extract the unique rows by using the formula: =UNIQUE(HSTACK(MONTH(date),event,email))
Wrap the distinct record logic inside a LET function and use PIVOTBY to count occurrences. Enter the full formula: =LET(distinct,UNIQUE(HSTACK(MONTH(date),event,email)), m,CHOOSECOLS(distinct,1), e,CHOOSECOLS(distinct,2), PIVOTBY(e,m,m,COUNT))
Press Enter to execute the formula. Excel will automatically spill the summarized matrix displaying unique attendee counts by event and month.

Use UNIQUE Function with COUNTIFS Helper Table
A reliable alternative if the PIVOTBY function is not yet available in your specific Excel version.
Easily Count Unique Attendees Using WPS Spreadsheet
WPS Spreadsheet offers powerful data analysis tools, including dynamic array functions and advanced Pivot Tables, allowing you to easily summarize unique participants without needing expensive subscriptions.
- 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your attendance dataset.
- 2. Insert a PivotTable: Select your entire data range, navigate to the 'Insert' tab on the top ribbon, and click 'PivotTable'.
- 3. Configure the PivotTable fields: In the PivotTable fields pane, drag 'Month' to the Columns area, 'Activity' to the Rows area, and 'Email' to the Values area.
- 4. Apply Distinct Count: Click on the 'Email' field dropdown in the Values area, select 'Value Field Settings', and choose 'Distinct Count' to summarize the unique participants automatically.

Frequently Asked Questions
Why does the PIVOTBY function return a #NAME? error?
The PIVOTBY function is currently rolling out and may only be available in the Microsoft 365 Insider Beta channel. If your Excel version doesn't support it yet, you should use standard Pivot Tables or a combination of the UNIQUE and COUNTIFS functions instead.
Can I count distinct values using standard Pivot Tables?
Yes. By checking the option to 'Add this data to the Data Model' when creating a Pivot Table, you can access the 'Distinct Count' aggregation option in the Value Field Settings. This allows you to count unique attendees without complex formulas.
What does the HSTACK function do in this scenario?
HSTACK horizontally combines the Month, Event, and Email arrays into a single contiguous dataset in memory. This allows the UNIQUE function to evaluate the unique combinations across all three columns simultaneously.
How can I extract a list of unique email addresses instead of just counting them?
You can use the UNIQUE function directly on the email column (e.g., =UNIQUE(C2:C100)). To extract unique emails for a specific month or activity, combine UNIQUE with the FILTER function to narrow down the dataset before extracting distinct values.




