Text and cleaning · About 5 minutes
Turn text into numbers with VALUE
Numbers copied from a PDF, a website or a bank export often arrive as text. They look like numbers, but SUM skips them, so your total comes out too small. A lookup for 104 won't match the text "104" either.
VALUE turns text that looks like a number into a real number. =VALUE( reads as "turn the text in B2 into a number". It ignores spaces at the ends and the commas between thousands.
Clean each amount into its own column first. Then total, compare or look up the clean column.
Part of Plus
Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.
What VALUE does
VALUE turns text that looks like a number into a real number. Numbers copied from a PDF, a website or an export often arrive as text: they look fine, but SUM skips them, so a total comes out too small or shows 0.
VALUE fixes that one cell at a time. It understands the commas between thousands and ignores spaces at the start and the end. Once the column holds real numbers, totals, averages and lookups work again.
How to write VALUE
=VALUE(
- text
- The cell holding the number stored as text, like A2, or text in quotes, like
"1,250". If the text doesn't read as a number, VALUE gives a#VALUE!error.
VALUE worked example
Stock counts pasted from a report are stored as text. In B2, turn the text in A2 into a number, then fill down to B5.
| A | B | |
|---|---|---|
| 1 | Pasted | Number |
| 2 | 1,250 | 1,250 |
| 3 | 480 | 480 |
| 4 | 3,005 | 3,005 |
| 5 | 75 | 75 |
=VALUE( A2)Turn the text in A2 into a number: the first row shows 1250. Filled down, the column shows 1250, 480, 3005 and 75, real numbers that SUM can add.Common VALUE mistakes
VALUE gives #VALUE!
The text has something that isn't part of a number, like a unit such as kg or a letter. Remove it with SUBSTITUTE first, then wrap the result in VALUE.
SUM still shows the old total
SUM is probably still pointing at the text column. Point it at the new column of VALUE results instead.
Numbers sit on the left of the cell
That is the usual sign of numbers stored as text, since real numbers line up on the right. In Excel, a small green triangle in the corner of the cell also offers Convert to Number.
VALUE or SUBSTITUTE?
Use VALUE when the text holds only a number, maybe with commas or spaces. When there is something extra to strip first, like a dash or a letter, remove it with SUBSTITUTE and put that inside VALUE.
VALUE works the same way in Excel and Google Sheets. Multiplying the text by 1 often converts it too, but VALUE says what you mean, so the formula is easier to read later.
Questions people ask
Why is my SUM formula returning 0?
The numbers are stored as text, so SUM skips them. Convert them with VALUE, or select them and use Convert to Number.
How do I convert text to a number in Excel?
Use =VALUE( in a helper column. Multiplying by 1, as in =A2, also works.
What does the green triangle in a cell mean?
Excel thinks something needs checking, most often a number stored as text. Click the warning icon next to the cell to see the reason and the fix.
Why does VALUE give #VALUE!?
The text holds something that isn't part of a number, such as a unit ("12 kg") or a currency sign your settings don't use. Remove it with SUBSTITUTE first.
Do I need VALUE in Google Sheets?
Sometimes. Sheets can also keep pasted numbers as text, and VALUE fixes them the same way.