Formula Errors

Fix a #NUM! Error in Excel INDEX and LARGE Formulas

Camila MilosovichCamila Milosovich Dec 2, 2026 869 views

Question details

Find out why a formula using INDEX and LARGE returns #NUM! while sorting lookup results.

How to Fix a #NUM! Error in Excel INDEX and LARGE Formulas
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet ranks lookup results in K5:K38 using the LARGE function.
Observed behavior
LARGE returns #NUM! when the requested rank exceeds the number of numeric values in the range.
Before you start

Check the range and rank used in your LARGE formula. In an empty cell, enter =COUNT(K5:K38) to see how many numeric values are available.

Solution 1Recommended

Limit the LARGE rank to available numeric values

Use this approach when a ranking formula is copied down and may request more values than the range contains.

1
Count the numeric values

Enter =COUNT(K5:K38) in an empty cell. LARGE(K5:K38,34) needs at least 34 numeric values.

2
Check the requested rank

Select the cell with the LARGE formula and compare its second argument with the COUNT result. The rank must be at least 1 and no greater than the numeric count.

3
Guard a copied ranking formula

For a standalone ranking list, enter =IF(ROWS($A$1:A1)<=COUNT($K$5:$K$38),LARGE($K$5:$K$38,ROWS($A$1:A1)),"") in the first result cell, then copy it down. It returns a blank when there are no more numeric ranks.

Limit the LARGE rank to available numeric values
Check the surrounding formula: If LARGE is nested inside INDEX, adjust the rank logic within your existing formula. INDEX can also produce its own errors, such as #REF!, when a row or column index is outside the selected range.
Work with spreadsheet formulas

Check LARGE Formula Ranks in WPS Spreadsheet

Open your workbook in WPS Spreadsheet, count the available numeric values, and adjust the LARGE rank or lookup fallback to prevent unavailable ranks.

  1. 1. Open the workbook: In WPS Spreadsheet, choose Open and select your Excel workbook.
  2. 2. Count numeric results: Enter =COUNT(K5:K38) in an empty cell and compare the result with the rank in your LARGE formula.
  3. 3. Adjust the formula: Select the formula cell and use a rank no greater than the COUNT result, or add an IF check before calling LARGE.
  4. 4. Save the workbook: Choose Save As and select an Excel format such as XLSX if you need to share the workbook with Excel users.
Check numeric counts and LARGE ranks in a spreadsheetOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and worksheet controls
microsoft office alternative - wps office

Frequently Asked Questions

Why does LARGE(K5:K38,34) return #NUM!?

The range has 34 cells, but LARGE needs 34 numeric values to return the 34th-largest value. Enter =COUNT(K5:K38) to check how many numbers it contains.

Does LARGE count hyphens or blank cells?

No. LARGE ranks numeric values, so a hyphen returned as text or a blank cell does not provide a numeric rank.

Can I hide the error with IFERROR?

Yes. For example, =IFERROR(LARGE(K5:K38,34),"") displays a blank instead of an error. It also hides other errors in the LARGE expression, so check the range and rank first.

Will replacing missing values with zero always give the right sort order?

No. Zero becomes part of the ranking and will appear above negative numbers. Use a blank or limit the requested rank if missing results should not be ranked.