Function Problems

How to List and Count Unique Values by Criteria in Excel

Bushra ParveenBushra Parveen Nov 10, 2026 869 views

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.

How to List and Count Unique Values by Criteria in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target output cell

Click on the empty cell where you want the upper-left corner of your summary table to begin.

2
Define data arrays with LET

Start your formula by assigning your data ranges to variables. For example: =LET(row_field,Tasks[Wave '#], values, HSTACK(Tasks[Task '#],Tasks[Task Status])

3
Set the aggregation functions

Add your calculation variables. Use HSTACK to line up the aggregation types: fn, HSTACK(COUNTA, ARRAYTOTEXT, ARRAYTOTEXT).

4
Apply GROUPBY and execute

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 Dynamic Array Functions (GROUPBY, LET, HSTACK)
Formula Customization: You will need to adjust the structured references (like Tasks[Wave '#]) to perfectly match your actual table and column names.
Advanced Data Analysis in WPS Spreadsheet

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. 1. Open your data file: Launch WPS Spreadsheet and open the workbook containing your task table.
  2. 2. Select a destination cell: Click on the blank cell where the grouped data summary should be generated.
  3. 3. Enter the dynamic formula: Input your grouping array formula, combining functions that extract and count unique list values.
  4. 4. Spill the array results: Press Enter to instantly process the data and spill the aggregated text arrays and counts into the adjacent cells.
Fully compatible with Microsoft Excel formulas, dynamic arrays, and structured table references.Seamlessly evaluate complex array formulas like LET, FILTER, and text aggregations for unique counts.Lightweight, lightning-fast performance even when processing massive data tables.Completely free to use with an intuitive, familiar user interface.
microsoft office alternative - wps office

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.