How to Return Exactly the Top 10 Values in Excel (Handling Ties)
Question details
The user needs a method to extract exactly the top 10 values from a daily changing dataset, specifically requiring a solution that limits the output to 10 rows even when tied values exist, and gracefully handles datasets with fewer than 10 records.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Extracting a top 10 list (e.g., top nationalities by visitor count) from a dynamic dataset where standard top-value threshold filtering might return more than 10 rows due to ties.
- Observed behavior
- When multiple records have identical amounts at the threshold level, filtering by a top-10 threshold can return more than 10 rows. The goal is to calculate or display exactly the first 10 values after sorting.
Ensure you are using a modern version of Excel or WPS Spreadsheet that supports dynamic array functions such as TAKE, SORTBY, FILTER, and HSTACK, as these are required to restrict output size dynamically.
Use Dynamic Array Formulas (TAKE, SORTBY, FILTER)
This method guarantees exactly 10 rows (or all available records if fewer than 10 exist) by sorting the data and cutting off the output at a strict row count, ignoring ties.
Standard top-10 filtering might return 11 or more rows if the 10th and 11th values are identical. By sorting the data first and then extracting the top N records using the TAKE function, we bypass the threshold tie issue completely.
Use the FILTER function to remove any empty rows from your source data. For example: FILTER(HSTACK(Nationalities, Visitors), Visitors<>"")
Wrap the filtered result in the SORTBY function to arrange the data in descending order based on your numeric column (e.g., Visitors). Use -1 as the sort order argument.
To avoid errors when your data has fewer than 10 entries, calculate the maximum rows available using MIN(10, ROWS(FILTER(Nationalities, Visitors<>""))).
Wrap everything inside the TAKE function to return exactly the specified number of rows. The final formula looks like: =TAKE(SORTBY(FILTER(HSTACK(Nationalities,Visitors),Visitors<>""),Visitors,-1),MIN(10,ROWS(FILTER(Nationalities,Visitors<>""))))

Use the Built-in Top 10 AutoFilter
A quick, no-formula method for basic data analysis, suitable when strict row limits are not required and tied values are acceptable.
Easily Extract Top Values with WPS Spreadsheet
WPS Spreadsheet fully supports advanced dynamic array functions and powerful built-in filtering tools. Extracting exact top 10 lists, handling ties, and managing dynamic daily data is seamless and highly efficient.
- 1. Install WPS Office: Download and install WPS Office for free from the official website.
- 2. Open Your Data: Launch WPS Spreadsheet and open your daily visitor workbook.
- 3. Enter the Formula: Input the dynamic TAKE and SORTBY formula into your desired output cell.
- 4. Get Instant Results: Press Enter to instantly populate the spilled array, displaying exactly the top 10 records.

Frequently Asked Questions
Why does the standard Top 10 filter sometimes show 11 or more rows?
This happens when there are tied values at the threshold. If the 10th and 11th items have the exact same value, standard filtering includes both because it filters by the numerical threshold, not the strict row count. Using the TAKE function after sorting prevents this.
What happens if my dataset has fewer than 10 items?
If you request 10 items but only 7 exist, standard array formulas might return a #CALC! or #REF error depending on how they are written. To handle this gracefully, calculate the minimum between your requested number (10) and the actual number of available rows using MIN(10, ROWS(data)).
Can I extract the top 10 values based on specific criteria from another column?
Yes. You can use the FILTER function to first isolate data based on your specific criteria (such as filtering by a specific month or category). Then, wrap that filtered result inside the SORTBY and TAKE functions to extract the top 10 values from that specific subset.




