Fix Excel #VALUE! Error: Wrong Data Type in Formula

beginnerπŸ“Š Microsoft Excel2026-03-18| Microsoft Excel 2016, 2019, 2021, Microsoft 365 (Windows and macOS)

Error Message

#VALUE!
#excel#formula#value-error

TL;DR

The #VALUE! error means Excel received a data type it wasn't expecting β€” usually text where it needed a number. Four things to check first:

  • Text strings mixed into numeric calculations
  • Hidden spaces in cells (looks empty, isn't)
  • Dates stored as text instead of real date serials
  • Array formulas not confirmed with Ctrl+Shift+Enter (Excel 2019 and older)

Quick workaround: wrap your formula with IFERROR() to suppress the error while you track down the cause. Use VALUE() to coerce text into numbers.

What's Actually Happening

When Excel hits #VALUE!, it's not broken β€” it understood the formula just fine. The problem is the data you handed it. Think of it as Excel saying: "I know how to do this math, but you gave me words."

Here's what typically trips it up:

  • Math on text: =A1 + B1 where A1 contains "five" instead of 5
  • Space-only cells: A cell with a single space looks blank but isn't β€” Excel treats it as text
  • Text-formatted dates: CSV and API imports often drop dates in as strings like "2024-01-15" instead of real Excel date serials
  • Wrong argument type: Passing a range to a function expecting a single value β€” =LEN(A1:A10) is a classic example
  • Non-numeric characters in numbers: "$1,200" or "1.5kg" look like numbers but Excel can't do arithmetic on them

Diagnosing the Problem

Step 1 β€” Find the culprit cell

Click the cell showing #VALUE!. Then go to Formulas β†’ Error Checking β†’ Trace Error. Blue arrows will appear pointing at every cell feeding into your formula. Work through each one.

Step 2 β€” Check if numbers are stored as text

Select a suspect cell. A small green triangle in the top-left corner is Excel flagging a number stored as text. For a more detailed check, this VBA snippet tells you exactly what type a cell holds:

Sub CheckCellType()
    Dim c As Range
    Set c = ActiveCell
    MsgBox "Type: " & TypeName(c.Value) & ", IsText: " & (c.NumberFormat = "@")
End Sub

Step 3 β€” Hunt for hidden spaces

Next to a suspect cell, run this in an empty column:

=LEN(A1)

A truly blank cell returns 0. If you see 1 or higher, something's hiding β€” a space, a non-breaking space, or a stray line break from an import.

Fix Approaches

Fix 1 β€” Convert text to numbers with VALUE()

Got "123" sitting in a cell as text? Wrap it:

=VALUE(A1) + B1

Prefer not to use a function? These math tricks coerce text-numbers directly:

=A1 * 1
=A1 + 0
=--A1

The double-negative (--) is the most common shorthand. It flips the value negative then back again, forcing the conversion as a side effect.

Fix 2 β€” Strip hidden spaces with TRIM() and CLEAN()

TRIM() clears leading, trailing, and double spaces. CLEAN() goes further β€” it removes non-printable characters like line breaks that sneak in from imported data. Stack them together:

=VALUE(TRIM(CLEAN(A1)))

One edge case: non-breaking spaces (ASCII 160, common in web-scraped data) survive TRIM(). You need SUBSTITUTE() for those:

=SUBSTITUTE(A1, CHAR(160), "")

Fix 3 β€” Fix text-formatted dates

Dates imported as strings like "2024-01-15" need DATEVALUE() to become real date serials:

=DATEVALUE(A1)

Format the resulting cell as a Date afterward. For US-style dates ("01/15/2024"), add a TEXT() wrapper:

=DATEVALUE(TEXT(A1,"MM/DD/YYYY"))

There's also a no-formula trick: select the column, go to Data β†’ Text to Columns, and click Finish without changing anything. Excel re-parses the values on exit and often fixes text dates automatically.

Fix 4 β€” Use IFERROR() to suppress while you debug

=IFERROR(A1 + B1, 0)
=IFERROR(VLOOKUP(D1, A:B, 2, 0), "Not found")

This returns a fallback value instead of showing the error. It's useful for unblocking downstream cells while you track down the root cause. Don't leave it as a permanent fix β€” it masks real problems.

Fix 5 β€” Handle SUM() across text safely

SUM() silently skips text cells. The + operator does not:

-- Errors if any cell contains text:
=A1 + A2 + A3

-- Safely skips text cells:
=SUM(A1:A3)

-- Also skips errors (useful for dirty data):
=AGGREGATE(9, 6, A1:A3)

Switching from + to SUM() alone fixes a surprising number of #VALUE! errors.

Fix 6 β€” Paste Special to convert a whole column

Bulk-converting a column of text-numbers? No need to write formulas:

  • Type 1 in any empty cell and copy it
  • Select the column of text-numbers
  • Right-click β†’ Paste Special β†’ Multiply
  • Excel multiplies each cell by 1, converting text to actual numbers in place

Verification

Once you've applied a fix, a few quick checks confirm it actually worked:

  • The #VALUE! error is gone and shows a real result
  • Numbers sit right-aligned in the cell (text defaults to left-aligned)
  • =ISNUMBER(A1) returns TRUE
  • =ISTEXT(A1) returns FALSE for what should be a number

This diagnostic formula classifies every cell in one shot:

=IF(ISNUMBER(A1), "Number", IF(ISTEXT(A1), "Text", IF(ISBLANK(A1), "Blank", "Other")))

Further Reading

  • Microsoft Support β€” How to correct a #VALUE! error
  • Excel functions: IFERROR, ISERROR, VALUE, TRIM, CLEAN, DATEVALUE
  • Power Query as an alternative for bulk data type fixing on import

Related Error Notes