logo
search
Formula Errors

How to Sum the Highest N Numbers in Excel While Ignoring Blank Cells

Phi Hung VoPhi Hung Vo Oct 19, 2026 869 views

Question details

The user wants to sum a specific number of the highest numeric values (top N) in a dataset but encounters a #NUM! error when the range contains blank or missing entries.

How to Sum the Highest N Numbers in Excel While Ignoring Blank Cells
Product
Excel
Device & OS
not provided
Scenario
Calculating a final total based on the best N results (e.g., grading the top 7 out of 9 assignments) when some scores have not yet been entered, leaving cells blank.
Observed behavior
Using standard SUM and LARGE functions results in a #NUM! error because the formula requests more numbers than the range currently contains due to the blank cells.
Before you start

Ensure you know the exact target range of your data and the specific number (N) of top values you wish to sum. Verify that your blank cells are truly empty and do not contain hidden space characters.

Solution 1Recommended

Use a Dynamic Array Formula with COUNT and SEQUENCE

This method dynamically limits the LARGE function to request only the available number of numeric values, successfully bypassing the #NUM! error when dealing with incomplete data.

The standard LARGE function throws a #NUM! error if you ask for the Nth largest value but the range contains fewer than N numbers.

By combining IF, COUNT, SUM, LARGE, SEQUENCE, and MIN, the formula dynamically limits the request to the actual count of numbers present. This allows it to smoothly ignore blanks and correctly sum whatever top values are currently available.

1
Select the destination cell

Click on the cell where you want the final sum calculation to appear.

2
Enter the dynamic SUM and LARGE formula

Type `=IF(COUNT(range)=0,0,SUM(LARGE(range,SEQUENCE(MIN(n,COUNT(range))))))` into the formula bar. Replace 'range' with your actual data range and 'n' with the number of top values you want to sum.

3
Apply the formula to your specific range

For example, to sum the best 7 scores in cells A1 through A9, type: `=IF(COUNT(A1:A9)=0,0,SUM(LARGE(A1:A9,SEQUENCE(MIN(7,COUNT(A1:A9))))))` and press Enter.

Use a Dynamic Array Formula with COUNT and SEQUENCE
Formula Breakdown: The MIN function checks if the actual count of numbers is smaller than your target N. SEQUENCE generates an array up to that minimum count, ensuring LARGE only retrieves available numbers and never triggers an error.
Efficient Spreadsheet Calculations

Calculate Top Values Seamlessly in WPS Spreadsheet

WPS Office Spreadsheet fully supports advanced array formulas, including SEQUENCE, LARGE, and nested logical checks. It handles complex grading structures and data summaries just as powerfully as Microsoft Excel.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the scores or incomplete data entries.
  2. 2. Apply the dynamic formula: Select the destination cell and input the combined IF, SUM, and LARGE array formula provided in the solution.
  3. 3. Calculate and update instantly: Hit Enter to view the accurate sum. Any blank cells updated with data later will dynamically refresh your total.
Fully compatible with Microsoft Excel formulas and .xlsx file formatsNative support for dynamic array functions like SEQUENCE to avoid #NUM! errorsLightweight, fast, and completely free for everyday data management
microsoft office alternative - wps office

Frequently Asked Questions

Why does the LARGE function return a #NUM! error with blank cells?

The LARGE function returns a #NUM! error when the 'k' parameter (the target position from the largest value) is greater than the total number of data points available in the referenced array. Blanks reduce the total data points, causing the error if the target 'N' isn't adjusted dynamically.

Can I use this formula in older spreadsheet versions?

The SEQUENCE function is available in newer software versions (Microsoft 365, Excel 2021, and modern WPS Office). For older versions, you may need to use an array formula utilizing ROW and INDIRECT instead of SEQUENCE, and execute it using Ctrl+Shift+Enter.

Will this formula ignore cells with text or zero values?

The formula ignores blank cells and text strings because the COUNT function only tallies true numerical values. However, if a cell explicitly contains a zero (0), it is counted as a valid numeric entry and will be evaluated by the LARGE function.

How do I sum the lowest N numbers instead of the highest?

To sum the lowest numbers while ignoring blanks, simply replace the LARGE function in the formula with the SMALL function. All other logic handling the blank cells remains exactly the same.