Numbers stored as text sit on the left of the cell, often with a green triangle, and SUM and VLOOKUP ignore them. The quickest fix: select the cells, click the warning icon and choose Convert to Number. In a formula, =--A2 or =VALUE(A2) does the same.
{"cells": {"A1": "Question", "A10": "=\"980\"", "A11": "=\"3100\"", "A12": "=\"450\"", "A2": "SUM of the text", "A3": "SUM after converting", "A4": "How many are text", "A8": "Amount (as text)", "A9": "=\"1250\"", "B1": "Answer", "B10": "=--A10", "B11": "=--A11", "B12": "=--A12", "B2": "=SUM(A9:A12)", "B3": "=SUMPRODUCT(--A9:A12)", "B4": "=SUMPRODUCT(--ISTEXT(A9:A12))", "B8": "As number", "B9": "=--A9"}, "focus": "B2", "note": "Column A holds text. SUM ignores it; the double minus in column B turns it into numbers."}
Convert to Number
Select the cells, click the yellow warning icon next to them, Convert to Number. Works for a whole column at once.
Warning icon → Convert to NumberFixes the cells themselves.Text to Columns
Select the column, Data → Text to Columns → Finish. Excel re-reads every cell as a number or date.
Data → Text to Columns → FinishFast for thousands of rows.In a formula
Keep the original data and convert inside the formula.
=--A2Two minus signs turn text into a number.=VALUE(A2)The same, easier to read.=--SUBSTITUTE(A2, " ", "")Removes spaces first: "1 250" becomes 1250.Common mistakes
- VALUE returns #VALUE!
- The text has something that isn't a number: a space, a currency sign, or a comma as the decimal separator. Clean it with SUBSTITUTE first.
- Lookups still fail
- Only one side was converted. The value you look up and the table must both be numbers, or both text.
Frequently asked questions
How do I find numbers stored as text?
=ISNUMBER(A2) is FALSE for them; =ISTEXT(A2) is TRUE. See ISNUMBER.
Why does VLOOKUP return #N/A for a number that's there?
One of them is text. It's trap 4 in VLOOKUP vs XLOOKUP.
How do I convert text to a date?
Use DATE with LEFT, MID and RIGHT. See DATE.