Formula Errors

How to Fix the #NUM! Error in Excel

Fix the #NUM! error in Excel by checking for negative inputs, numbers too large for Excel, and finance functions like IRR that need a sensible guess.

On this page
  1. Math that has no answer
  2. A result that is too large or too small
  3. Finance functions that don’t converge
  4. A position outside the range
  5. Find the bad input
  6. Google Sheets

The #NUM! error means a formula received a number that the calculation can’t use, or it produced a result Excel can’t display. The cause is usually a number outside the range that a particular function accepts. The fix depends on the function, so check what it expects.

Math that has no answer

Some functions aren’t defined for certain numbers:

  • SQRT returns #NUM! for a negative number, such as =SQRT(-9).
  • LN and LOG return #NUM! for zero or negative numbers.

You can guard against this with a test. =IF(A2<0,"",SQRT(A2)) returns a blank for negative values and the square root otherwise. The guide on how to use if function in excel covers the structure of that kind of test.

A result that is too large or too small

Excel can only store numbers within a certain range, so a calculation that grows past that range can return #NUM!. Powers are a common example. A formula such as =10^400 produces a number too large to store. Check the scale of the numbers in the calculation, and make sure the inputs are in the units you expect.

Finance functions that don’t converge

IRR, RATE and XIRR work by trying repeated guesses until they reach an answer. If they can’t get there within the number of tries they allow, they return #NUM!. Common reasons include:

  • No mix of signs. IRR usually needs at least one positive and one negative cash flow.
  • A guess far from the answer. You can add a guess as the second argument. For example, =IRR(B2:B6,0.1) starts the search at 10%.
  • Reversed signs. Money you receive should be positive, and money you pay should be negative. Mixing these up can make a solution impossible to find.

A position outside the range

LARGE and SMALL return #NUM! when the position you ask for is bigger than the number of values. For example, =LARGE(A2:A5,5) returns #NUM! when the range holds only four numbers. Use COUNT to see how many numbers the range holds, and keep the position within that count.

Find the bad input

  1. Click the cell and read the formula.
  2. Use Evaluate Formula to see the result of each part.
  3. Check the inputs with ISNUMBER, and look for negative values, zeros, and values too large for the function.

Google Sheets

Google Sheets returns #NUM! for invalid numbers in math functions too. The same checks apply there: confirm the inputs are numbers, check the signs, and use the same guard formulas.

The complete guide to formula errors

Excel Formula Error Messages Explained
Read the guide

Keep exploring

Guides from other topics

All topics →