How to convert text to number in Excel

The tutorial shows many different ways to turn a string into a number in Excel: Convert to Number error checking option, formulas, mathematic operations, Paste Special, and more.

Sometimes values in your Excel worksheets look like numbers, but they don't add up, don't multiply and produce errors in formulas. A common reason for this is numbers formatted as text. In many cases Microsoft Excel is smart enough to convert numerical strings imported from other programs to numbers automatically. But sometimes numbers are left formatted as text causing multiple issues in your spreadsheets. This tutorial will teach you how to convert strings to "true" numbers.

How to identify numbers formatted as text in Excel

Excel has an inbuilt error checking feature that alerts you about possible problems with cell values. This appears as a small green triangle in the top left corner of a cell. Selecting a cell with an error indicator displays a caution sign with the yellow exclamation point (please see the screenshot below). Put the mouse pointer over the sign, and Excel will inform you about the potential issue: The number in this cell is formatted as text or preceded by an apostrophe.
Number formatted as text in Excel.

In some cases, an error indicator does not show up for numbers formatted as text. But there are other visual indicators of text-numbers:

Numbers Strings (text values)
  • Right-aligned by default.
  • If several cells are selected, the Status Bar shows Average, Count and SUM.
  • Left-aligned by default.
  • If several cells are selected, the Status Bar only shows Count.
  • The Number Format box displays the Text format (in many cases, but not always).
  • There may be a leading apostrophe visible in the formula bar.

In the image below, you can see the text representations of numbers on the right and actual numbers on the left:
The text representations of numbers and actual numbers in Excel

How to convert text to number in Excel

There are a handful of different ways to change text to number of Excel. Below we will cover them all beginning with the fastest and easiest ones. If the easy techniques don't work for you, please don't get disheartened. There is no challenge that cannot be overcome. You will just have to try other ways.

Convert to number in Excel with error checking

If your cells display an error indicator (green triangle in the top left corner), converting text strings to numbers is a two-click thing:

  1. Select all the cells containing numbers formatted as text.
  2. Click the warning sign and select Convert to Number.

Done!
Excel's Convert to Number error checking feature

Convert text into number by changing the cell format

Another quick way to convert numerical values formatted as text to numbers is this:

  1. Select the cells with text-formatted numbers.
  2. On the Home tab, in the Number group, choose General or Number from the Number Format drop-down list.

Convert text to number by changing the format.

Note. This method does not work in some scenarios. For example, if you apply the Text format to a cell, enter a number, and then change the cell format to Number, the cell will remain formatted as text.

Change text to number with Paste Special

Compared to the previous techniques, this method of converting text to number requires a few more steps, but works almost 100% of time.

To fix numbers formatted as text with Paste Special, here's what you do:

  1. Select the text-number cells and set their format to General as explained above.
  2. Copy a blank cell. For this, either select a cell and press Ctrl + C or right-click and choose Copy from the context menu.
  3. Select the cells you want to convert to numbers, right-click, and then click Paste Special. Alternatively, press the Ctrl + Alt + V shortcut.
  4. In the Paste Special dialog box, select Values in the Paste section and Add in the Operation section.
  5. Click OK.

Change text to number with Paste Special.

If done correctly, your values will change the default alignment from left to right, meaning Excel now perceives them as numbers.

Convert string to number with Text to Columns

It is another formula-free way to convert text to number in Excel. When used for other purposes, for example to split cells, the Text to Columns wizard is a multi-step process. To perform the text to number conversion, you click the Finish button in the very first step :)

  1. Select the cells you'd like to convert to numbers, and make sure their format is set to General.
  2. Switch to the Data tab, Data Tools group, and click the Text to Columns button.
  3. In step 1 of the Convert Text to Columns Wizard, select Delimited under Original data type, and click Finish.

That's all there is to it!
Convert string to number with Text to Columns.

Convert text to number with a formula

So far, we have discussed the built-in features that can be used to change text to number in Excel. In many situations, a conversion can be done even faster by using a formula.

Formula 1. Convert string to number in Excel

Microsoft Excel has a special function to convert a string to number - the VALUE function. The function accepts both a text string enclosed in quotation marks and a reference to a cell containing the text to be converted.

The VALUE function can even recognize a number surrounded by some "extra" characters - it's what none of the previous methods can do.

For example, a VALUE formula recognizes a number typed with a currency symbol and a thousand separator:

=VALUE("$1,000")

=VALUE(A2)

To convert a column of text values, you enter the formula in the first cell, and drag the fill handle to copy the formula down the column:
VALUE formula to convert a string to a number.

For more information, please see VALUE formula to convert text to number.

Formula 2. Convert string to date

Apart from text-numbers, the VALUE function can also convert dates represented by text strings.

For example:

=VALUE("1-Jan-2018")

Or

=VALUE(A2)

Where A2 contains a text-date.

By default, a VALUE formula returns a serial number representing the date in the internal Excel system. For the result to appear as an actual date, you just have to apply the Date format to the formula cell.
VALUE formula to change a text string to a date.

The same result can be achieved by using the DATEVALUE function:

=DATEVALUE(A2)

For more information, please see How to convert text to date in Excel.

Formula 3. Extract number from string

The VALUE function also comes in handy when you extract a number from a text string by using one of the Text functions such as LEFT, RIGHT and MID.

For example, to get the last 3 characters from a text string in A2 and return the result as a number, use this formula:

=VALUE(RIGHT(A2,3))

The screenshot below shows our convert text to number formula in action:
Extract a number from a text string.

If you don't wrap the RIGHT function into VALUE, the result will be returned as text, more precisely a numeric string, which makes any calculations with the extracted values impossible.

For more information, please see How to extract number from string in Excel.

Change Excel string to number with mathematic operations

One more easy way to convert a text value to number in Excel is to perform a simple arithmetic operation that does not actually change the original value. What can that be? For example, adding a zero, multiplying or dividing by 1.

=A2+0

=A2*1

=A2/1

If the original values are formatted as text, Excel may automatically apply the Text format to the results too. You may notice that by the left-aligned numbers in the formula cells. To fix this, be sure to set the General format for the formula cells.
Converting a string to a number with mathematic operations

Tip. If you'd like to have the results as values, not formulas, use the Paste Special feature to replace formulas with their values.

That's how you convert text to number in Excel with formulas and built-in features. I thank you for reading and hope to see you on our blog next week!

212 comments

  1. I have already tried something like 10 methods to convert cells like this
    1 959,94
    (where the space is the thousand separator and the comma is the decimal separator) to numbers, but nothing has worked. What would work?

      • This is odd: my fresh Excel (Win 11) does not accept colons to separate arguments of the function but requires me to use semicolons. I can do that but when I wrote
        =SUBSTITUTE(A1," ","")
        it gave me still 1 959,94.

        Only after I wrote
        =SUBSTITUTE("1 959,94"," ","")
        it gives me 1959,94
        but there is no sense to write the contents of all the cells I have to convert to numbers by hand.

        What to do?

        • I cannot know what delimiters you use in formulas and what decimal separator is set in your regional Windows settings. Replace comma delimiters in the formula with semicolons, if necessary.
          If you use a dot as a decimal separator, replace the comma with a dot.

          =--SUBSTITUTE(SUBSTITUTE(A1," ",""),",",".")

          • My system separators that my Excel uses are the comma for the decimal separator and the space for the thousands separator.

            I have still the problem that when having
            1 959,94 in A1 and writing
            =SUBSTITUTE(A1," ","")
            the function gives me 1 959,94.

            Only after writing
            =SUBSTITUTE("1 959,94"," ","")
            the function gives me 1959,94.

            The numbers in my original data (a table copied from the internet using copy-paste) that are below 1000 (the numbers without the thousand separator) behave nicely as numbers without any tricks. _All_ the copy-pasted numbers align right in their cells. Only the numbers that include the thousand separator can't be used in calculations as their cause #VALUE! error. What could be the cause for this?

            • As mentioned in the article above, perform a mathematical operation on the text to convert it to a number. Read the article above carefully. Аlso take a look at my answers.
              For example,

              =--SUBSTITUTE(A1," ","")

              • As I have tried to explain when having
                1 959,94 in A1 and writing
                =SUBSTITUTE(A1," ","")
                the function gives me 1 959,94, i.e., the function does not remove the space. And if I try to for example multiply the result by 1, the result is the error
                #VALUE!

                I have managed to remove the space only if I type the first argument of the function by hand like this:
                =SUBSTITUTE("1 959,94"," ","")

    • Try this
      =VALUE(CONCAT(TEXTSPLIT(CONCAT(TEXTSPLIT(A1," ")), ",")))

    • It works
      =VALUE(CONCAT(TEXTSPLIT(CONCAT(TEXTSPLIT(A1," ")), ",")))/100

  2. I got it just by typing
    =[cell with number in text format]+0

    • After exhausting all the methods I could find on the web, I solved the problem by copying and pasting the problematic data to MS Word, then re-exporting to Excel as Text. It was immediately recognizable by Excel as values for purposes of applying formulas, summation, etc.

      • this works for me. thanks for your input

  3. this is not working in any of the solutions/function provided above . the excel i have uses "," for thousand separator and "." for decimals
    2.866.794,97 
    321.279,70 
    321.279,70 
    45.647,28 
    45.647,28 

  4. some times you need change seprator to"."
    may be before the change to text ,that seprator was "." but now seprator is"/"
    there is errore for change to value

  5. How can I convert a number (I get it from data from WEB) to Pivot table? Number in data is not appearing in pivot table. I used convert text to columns wizard and it work but every time I refresh the data, I need to go to convert text to columns wizard again.

  6. I want to convert from this value 1-120-00001297-7 to 1120000012977. How can i do? Thank you.

  7. Great explanation, thank you

    I encounter this problem with different way, I downlaoded a sheet that includes column "Budget", the cells in this colum are formatted as currency and it is left aligned, and the status bar shows only count. I tried to convert it to numbe by using Value function but it gives me error, the only way that worked with me, is selecting the cells and replace $ to blank, this makes the figures inside the cells numbers.
    Is there any explanation for this?

    • Hello!
      The $ sign in the cell was not obtained using number formatting. It is written as text. So when you remove it, the value becomes a number.

  8. This has been such a mightmare. I finally got the following to work. Following all your suggestions and more, I just replace-all'd elimination of "$" and "." and ".00" to get 2, 3, 4, and 5 digit numbers that stubbornly refused to go to numeric. I extracted from the left the correct number of digits -- eg, 50 wants =let(cell,2) -- then I had to =trim(new cell) **even though there is no apparent space anywhere in sight**. Still it's not numeric but at that point you can multiply by 1 and turn it into a freaking number: yay!!!

    You cannot imagine how long it has taken to get this to work.

    And you have to manually reset the number of digits to extract. extracting more than the visible digits and then triming, just doesn't work. (@@) go figure.

    • Did you manage to resolve this? I am having the same issue here.

  9. Hello, I'm trying to erase a space before a number (for thousands of cells which I got from another file) but I can't do it:
    Example: a cell contains a space before a number 1, and I need it to be just number 1, without a space before it.
    The problem with the number 1 after a space is that excel consider it a a text, the SUM of it is 0.
    When I overwrite a 1 in that cell which contains a space before the number 1, it converts to a number and SUM operates normally; but I can't do it cell by cell for thousands of cells.
    Please help me.

    • Hello!
      Have you tried the ways described in this blog post? Try Paste Special or Convert to Number as described in this article. These operations can be performed with the entire range of cells.

      • Dear Alexander, thank you very much for your kind answer.
        I tried Paste Special, but when I copied the cell it copied only those which were numbers already, and didn't copy the other "numbers" which doesn't work as numbers.

        When I look at the numbers in the columns I notice that the same number is a little bit (one space) to the left of the "so called number" (which cannot be added, etc)
        If I look at that cell in particular, which contains for instance 145 it has a space before the number,
        but if I replace that writing the number 145 over it, will not have any space before it and then it will work fine as a number.

        Can't understand what kind of format those so called numbers have.

        • Hi!
          If I understood correctly, you are copying the cells with your values, in which the numbers are written as text. Read the instructions carefully. Copy only one empty cell and then use Paste Special.

    • Do a 'find and replace' and put a space character in the find field and nothing in the replace field. It will apply to everything though....

    • Hello Tommy,
      Please try the TRIM function. (TDLR, google how to use TRIM)
      For example, if the column containing the numbers is A, and the first cell with data is A2 [not counting the header row], you should:
      1. Create (Insert a new column (B in our example)
      2 . In column B2, type: TRIM(A2)
      [this will give the output of the content of the content of cell A2 without any leading or trailing spaces]
      3. You can then fill the formula down by double-clicking the fill handle or any other way.
      [this will make the entire column B the same as A without any leading spaces]
      4. You can then copy column B and paste it in A as VALUES using the PASTE SPECIAL.

      I hope this helps.

  10. Hello,
    I am trying to convert Satisfaction surveys from text to numbers, to avoid manual converting for receiving a high number of surveys in a weekly. I was provided with the following formula with little to no information on how to add it on the exported repot. There is a main sheet, but the data needs to be add once the exported sheet is completed. The formula provided is below and I am trying to convert only one column from text to numbers.
    =IF(T3489="Extremely dissatisfied",1,IF(T3489="Somewhat dissatisfied",2,IF(T3489="Neither satisfied nor dissatisfied",3,IF(T3489="Somewhat satisfied",4,IF(T3489="Extremely satisfied",5,0)))))

    Hoping to hear back!

    • Hi!
      I don't quite understand how I can help. I can't see your data. Add this formula to your worksheet. Change the cell address if necessary.

    • I think the above formula is just working fine & is able yo convert the col containing the survey response to numbers. What is the exact issue, unable to comprehend from your message above.

  11. 14811.10
    10363.44
    1 059.00
    -4 534.00
    -10 104.90

    How to get this into numbers ? Text to Column doesnt work

    • Hello!
      Please try the following formula:

      =--SUBSTITUTE(A1," ","")

      If you use comma as decimal separator then use this formula

      =--SUBSTITUTE(SUBSTITUTE(A1,".",",")," ","")

      I'd recommend you to have a look at our Convert Text tool that can help you convert numbers stored as text to numbers. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.

  12. I have a list of names in excel which im looking to formulate into a list of numbers
    All names are differnt but im looking them to change into number formatt 1-8

    • Hi!
      Unfortunately, without seeing your data it is difficult to give you any advice. Please provide me with an example of the source data and the expected result.

  13. How do I convert a duration to show a number:
    example:
    0:07
    0:15
    0:35
    And convert these to read as:
    0,07
    0,15
    0,35

  14. I have non numerical data (responded in monkey survey) the responses are in word i.e. agree, strongly agree, disagree, strongly disagree for many questions. I have exported the data of the survey to Excel sheet and all the responses are in word (string). I need to analyses basic statics corelating it with one variable (like male/female respondents). How do I convert this strings to numeric for analysis in excel?.

  15. Hello
    I have
    1819VJO2045643_1
    2021RDO456326_1
    1920TDO785432_2
    Etc
    Etc

    Like this data with me i want to convert this string in to number or unique numbers how to convert please help me
    Thanks

    • Hello!
      To extract all numbers from text, try this formula:

      =CONCAT(IF(ISNUMBER(--MID(A1,ROW($1:$94),1)),MID(A1,ROW($1:$94),1),""))

      If this is not what you wanted, please describe the problem in more detail.

  16. I have cells containing a simple subtraction like 12-9. It needs to display like that so I have applied Text formatting to it. The cell next to it needs to display the calculation - in this case 3. Excel converts it to a date and displays 44451. The 12-9 needs to be changeable and not require reformatting after data entry. Hope you can help - thanks

  17. Hi,
    I am trying to convert a value with dollar sign in text to Numeric but Value Function is giving error instead of giving 400 & 500 as results. Excel doc also says this should work. What may be the probable reasons.
    I am posting the exact code below

    A B C
    1. Name Money Won Value
    2.
    3. Mico $400 #VALUE! #=VALUE(B3)
    4. Noah $500 #VALUE! #=VALUE(B4)

    • Hi!
      What are you trying to convert to a number, Mico $400 or $400? What formula are you using in cell B3? If you are trying to convert the value "$400" to a number, check which currency is set by default in the regional settings of Windows.

  18. Dear all, thank you for all these tips but it is not working for me. I need to change numbers stored as text into general format in order to be able to use a VLOOKUP formula. When I change my text into general I notice that the value change as well. For instance, it changes 92753660758293 into 92753660758290... How can I keep the right value? Many thanks for your answer.

    • Hello!
      I don't know how you turn text into numbers. There are many ways. I have not been able to replicate your problem. However, keep in mind that the maximum number of numeric digits in Excel is 15.

  19. A1= 1
    A2 = (1+5)/2 as text
    A3 = (2+4)/2 as text
    in A4 i need the formulated A1*A2*A3
    A2 & A3 only can be write as text type

  20. I have a large file with a column of data where I want to convert a 5 digit/character code alphanumeric text to number. Your instruction handles most of these cells in my file, but not for instances with an embedded alpha "E" character in the string. This column has 5-character codes that I wish to convert to number for a vlookup application. An example: a code of 71E62. I cannot get that cell (and many others) to convert to a number.

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)