Convert Text to a Number
Numbers imported from other systems are often stored as text: they are left-aligned, and SUM ignores them. VALUE converts them into real numbers, and NUMBERVALUE handles foreign decimal and thousands separators. Describe your data below and get the conversion formula.
Free, no sign-up required · 5 free generations a day
Last updated
Describe your task, get the formula
Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.
Formulas for converting text to numbers
=VALUE(A2)
=A2*1
=NUMBERVALUE(A2,",",".")VALUE converts text that looks like a number in your regional format. Multiplying by 1 forces the same conversion. NUMBERVALUE lets you state the separators: here a comma is the decimal separator and a full stop groups thousands, as in 1.234,56.
Examples
Convert a European-format number
=NUMBERVALUE(A2,",",".")Reads 1.234,56 as one thousand two hundred thirty-four point five six, whatever the regional settings of the computer.
Strip a currency symbol and commas
=VALUE(SUBSTITUTE(SUBSTITUTE(A2,"$",""),",",""))Removes the dollar sign and the thousands commas from text such as $1,250.00, then converts the remainder to a number.
Sum a column of text numbers directly
=SUMPRODUCT(--A2:A100)The double minus converts each text number on the fly, so you get the total without adding a helper column. Every cell must be numeric text or the formula returns #VALUE!.
Common mistakes and how to fix them
SUM returns 0 for a column of numbers
The cells are text. Convert them with VALUE in a helper column, or select the column and use Data, Text to Columns, Finish to convert in place.
#VALUE! from VALUE
The text contains something that is not part of a number: a space, a unit such as kg, or a non-breaking space. Remove it with SUBSTITUTE or TRIM first.
Changing the cell format to Number does nothing
Formatting does not re-read existing text. Re-enter the cell, or convert it with a formula or Text to Columns.
Frequently asked questions
How can I tell that a number is stored as text?
It is left-aligned by default, Excel shows a green triangle in the corner of the cell, and =ISNUMBER(A2) returns FALSE.
How do I keep leading zeros?
Converting to a number removes them. For codes such as ZIP codes or product IDs, keep the cell as text instead, or apply a custom number format such as 00000.
How do I convert the other way, from number to text?
Use =TEXT(A2,"0") for a plain number or a pattern such as "0.00" to fix the decimals. Joining an empty string with =A2&"" also works.
Don't want to write it by hand?
Describe what you need in plain English and get a ready-to-use formula in seconds.
Try the formula generator