logo
search
Function Problems

How to Return the Top 10 Names by Date and Boolean Criteria in Excel

Camila MilosovichCamila Milosovich Sep 28, 2026 871 views

Question details

The user needs a dynamic formula that filters records by a specific date and a True/False value, counts the occurrences of each name, ranks them, and extracts the top 10 names. A rolling three-month variation is also requested.

How to Return the Top 10 Names by Date and Boolean Criteria in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Creating an automated dashboard or report that extracts the top 10 most frequent names based on conditional date and boolean filters without using manual pivot tables.
Observed behavior
The user requires a single formula approach to successfully filter, count, rank, and limit the dataset to the top 10 matching results.
Before you start

Ensure you are using a modern spreadsheet version (like Office 365, Excel 2021, or the latest WPS Office) that supports dynamic array functions such as LET, FILTER, SORTBY, and TAKE.

Solution 1Recommended

Use Dynamic Array Functions to Extract the Top 10 Names

This solution uses a combination of modern array formulas to filter the raw data, count occurrences, sort in descending order, and extract exactly 10 rows.

By utilizing the LET function, you can define intermediate calculation steps within a single formula. This makes it easier to filter the data by your date and boolean criteria, calculate counts for unique names, and then sort and trim the final output.

1
Set up your criteria cells

Dedicate a cell for your date criteria (e.g., G1) and another for your Boolean True/False criteria (e.g., H1). Ensure your source data is organized in columns, for example, Names in Column A, Boolean in Column B, and Dates in Column C.

2
Filter the dataset

Use the FILTER function nested inside LET to extract only the names where the date matches G1 and the boolean matches H1. The logic looks like this: FILTER(A2:C16, (C2:C16=G1)*(B2:B16=H1)).

3
Find unique names and count frequencies

Apply the UNIQUE function to the filtered list of names. Next, use COUNTIFS to count how many times each unique name appears in the original dataset under the specified criteria.

4
Sort and limit to the Top 10

Combine the unique names and their counts using HSTACK. Wrap this in the SORT function to order the results by the count column in descending order. Finally, wrap the entire formula in the TAKE function with a parameter of 10 to return only the top 10 rows: TAKE(SORT(..., 2, -1), 10).

Use Dynamic Array Functions to Extract the Top 10 Names
Spill Range: Make sure there are at least 10 empty rows and 2 empty columns below your formula cell to allow the dynamic array results to spill without returning a #SPILL! error.
Advanced Spreadsheet Features

Use WPS Spreadsheet to Handle Dynamic Arrays Easily

WPS Spreadsheet fully supports advanced dynamic array functions like FILTER, SORT, UNIQUE, and TAKE, allowing you to build complex reports and extract top 10 lists effortlessly.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your .xlsx file containing the names, dates, and boolean values.
  2. 2. Select the destination cell: Click on the cell where you want the top-left corner of your Top 10 report to begin.
  3. 3. Input the dynamic array formula: Type your formula using LET, FILTER, and TAKE. The formula autocomplete will guide you through the syntax.
  4. 4. Press Enter to spill results: Hit Enter, and WPS Spreadsheet will automatically calculate and spill the sorted top 10 names and counts into the adjacent cells.
Fully compatible with Microsoft Excel formulas (.xlsx)Supports modern dynamic array functions for advanced data analysisFree, lightweight, and fast to load large datasetsIntuitive UI making formula auditing and editing seamless
microsoft office alternative - wps office

Frequently Asked Questions

Why does my dynamic array formula return a #NAME? error?

The #NAME? error usually occurs if your spreadsheet software version does not support newer functions like LET, SORTBY, or TAKE. Upgrading to Office 365, Excel 2021, or the latest version of WPS Office will resolve this.

How can I change the formula to return the top 5 names instead of top 10?

To adjust the number of results returned, simply change the row parameter in the TAKE function. For example, replace TAKE(array, 10) with TAKE(array, 5).

What happens if there is a tie in the top 10 ranking?

By default, the SORT or SORTBY function will list tied records in the order they appear in the source data. If you want to break ties alphabetically, you can add a secondary sorting column to your SORTBY function.