How to List and Count Unique Values by Criteria in Excel
Question details
The user needs to list unique task values, identify their types, and count occurrences based on a specific criteria such as a wave number.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Summarizing complex task table data by grouping records by specific criteria and simultaneously returning text lists and unique counts.
- Observed behavior
- Looking for a formula-based method to aggregate data natively and extract arrays of grouped texts and distinct counts without manually creating Pivot Tables.
Ensure you are using a spreadsheet version that supports modern dynamic array functions, as formulas like LET, HSTACK, and advanced grouping require updated environments to execute properly.
Use Dynamic Array Functions (GROUPBY, LET, HSTACK)
Combine modern dynamic array functions to dynamically group data, count distinct items, and concatenate text values into a single summary table.
This method uses the LET function to assign variables, keeping the formula clean, and passes data to the GROUPBY function. Aggregation features like COUNTA and ARRAYTOTEXT will handle the math and text extraction respectively.
Click on the empty cell where you want the upper-left corner of your summary table to begin.
Start your formula by assigning your data ranges to variables. For example: =LET(row_field,Tasks[Wave '#], values, HSTACK(Tasks[Task '#],Tasks[Task Status])
Add your calculation variables. Use HSTACK to line up the aggregation types: fn, HSTACK(COUNTA, ARRAYTOTEXT, ARRAYTOTEXT).
Complete the formula by referencing these variables in the GROUPBY function, e.g., agg, GROUPBY(row_field, values, fn, ,0). Press Enter to spill the results dynamically.

Use SQL Queries or Power Query for Grouping
If you are working with large datasets or querying databases, you can use a standard SQL approach or Excel's Power Query to group and concatenate distinct values.
Group and Aggregate Complex Data Effortlessly with WPS Spreadsheet
WPS Spreadsheet provides a robust and powerful environment for advanced data analysis. With support for modern functions and dynamic arrays, you can easily filter, list, and count unique values to streamline your workflows.
- 1. Open your data file: Launch WPS Spreadsheet and open the workbook containing your task table.
- 2. Select a destination cell: Click on the blank cell where the grouped data summary should be generated.
- 3. Enter the dynamic formula: Input your grouping array formula, combining functions that extract and count unique list values.
- 4. Spill the array results: Press Enter to instantly process the data and spill the aggregated text arrays and counts into the adjacent cells.

Frequently Asked Questions
Can I count unique values using a Pivot Table instead of formulas?
Yes. When creating a Pivot Table, check the box to 'Add this data to the Data Model'. This unlocks the 'Distinct Count' calculation in the Value Field Settings. However, note that Pivot Tables require manual refreshing, whereas dynamic arrays update in real time.
Why does my grouping formula return a #NAME? error?
The #NAME? error typically appears if your current version of the spreadsheet software does not support modern dynamic array functions like LET or GROUPBY. Check for software updates or use alternative methods like Power Query.
How do I list unique text values if GROUPBY is unavailable?
You can combine the UNIQUE, FILTER, and TEXTJOIN functions. Use FILTER to isolate records matching your criteria, wrap it in UNIQUE to remove duplicates, and then use TEXTJOIN to output the results as a single comma-separated string.




