Formula Errors

How to Fix the #VALUE! Error in Excel

Learn how to fix the Excel #VALUE! error by finding text that looks like a number, converting it, and cleaning hidden characters from your cells.

On this page
  1. What causes #VALUE!
  2. Find the cell with the text
  3. Convert numbers stored as text
  4. Clean hidden characters
  5. Check that ranges match in size
  6. Don’t hide it first
  7. Google Sheets

The #VALUE! error means a formula received a value of the wrong type. Most often a cell holds text where the formula expects a number, such as a number typed with a unit after it, or a date that Excel reads as text. The fix is usually to find that cell, convert or clean its contents, and then let the formula recalculate.

What causes #VALUE!

These are the most common causes:

  • Text in arithmetic. =A2*B2 returns #VALUE! if B2 contains words, such as “12 units” or “twelve”.
  • Numbers stored as text. A cell can look like a number and still be text. Excel often converts simple cases on its own, but hidden spaces or other characters can block the conversion.
  • Dates stored as text. A date that Excel doesn’t read as a date is text, so date math on it fails the same way. The reasons Excel treats dates as text are covered in excel not recognizing dates as dates.
  • Ranges of different sizes. SUMPRODUCT returns #VALUE! when the ranges it compares have different numbers of rows or columns.

One detail makes this harder to spot: SUM and AVERAGE skip text inside a range. A total can look correct even when a single-cell formula fails on the same text.

Find the cell with the text

  1. Click the cell that shows the error and read its formula.
  2. Go to Formulas > Trace Precedents to draw arrows to the cells it uses.
  3. Test the cells with ISNUMBER. In a spare column, type =ISNUMBER(A2) and fill it down. TRUE means the cell holds a number. FALSE means it holds text, or something else such as a blank.

Evaluate Formula is also useful here, because it shows the result of each part of the formula and makes it clear which piece returns the error.

Convert numbers stored as text

Several methods work. The right one depends on how many cells need fixing:

  • The warning menu. Select the cells, click the warning icon, and choose Convert to Number. This works when Excel flags a number stored as text.
  • Text to Columns. Select the column, go to Data > Text to Columns, and click Finish. In many cases this converts the whole column at once.
  • VALUE. =VALUE(A2) converts a text number to a number. It follows your computer’s regional settings, so a decimal comma on one machine can be read differently on another.
  • NUMBERVALUE. Available in Excel 2013 and later, =NUMBERVALUE(A2,".",",") lets you state the decimal and group separators yourself.
  • Double negative. =--A2 converts text to a number in one step. It’s short, but it’s harder to read if you’re new to Excel.

For the full set of conversion methods, see how to convert text to number in excel.

Clean hidden characters

When text still fails after conversion, look for hidden characters:

  • TRIM removes extra spaces between words and at both ends of the text. It doesn’t remove non-breaking spaces, which often come from web pages and exports.
  • CLEAN removes many non-printing characters, such as line breaks copied from another program.
  • SUBSTITUTE(A2,CHAR(160),"") removes non-breaking spaces. On Windows, CHAR(160) returns a non-breaking space. On a Mac the code can be different, so test the result there before relying on it.

These can be combined, for example =VALUE(TRIM(SUBSTITUTE(A2,CHAR(160),""))). For a longer list of the characters that cause trouble, see remove non printing characters in excel.

Check that ranges match in size

Functions that compare two ranges need both ranges to be the same size. The Name Box shows the address of a selected range, so compare the first and last row numbers of each range. If one range is a row longer than the other, SUMPRODUCT returns #VALUE!. Adjust the ranges so they start and end on the same rows.

Don’t hide it first

Wrapping the formula in IFERROR makes the error disappear, but the bad value is still there, and any total built on it may be incomplete. Fix the data first. Hiding the error is a last step, and only after you’re sure a blank or placeholder is the right result.

Google Sheets

Google Sheets shows #VALUE! for the same reasons. It doesn’t have the Convert to Number warning, but VALUE, TRIM, CLEAN and SUBSTITUTE work the same way there.

The complete guide to formula errors

Excel Formula Error Messages Explained
Read the guide

Keep exploring

Guides from other topics

All topics →

How to Look Up Data in Excel

How lookups work in Excel, with VLOOKUP, XLOOKUP and INDEX with MATCH, how to set up your data, and how to choose the right function for the job.

Lookups 3 min read