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!

207 comments

  1. I am still battling with this:
    There are a number of tricks you can use if you have a column of numbers in a format that Excel does not recognise as numbers. For example, let's say you have a column of numbers where some idiot has typed each number in using a comma as the thousands separator like this:

    52,321.45
    17,615.28
    19,785.98
    41,963.49

    If your version of Excel does not use commas for the thousands separator, (mine is et to use the apostrophe - ' -), or if some dummy actually typed in the commas, you can still quickly convert the entire column of text-numbers to numbers by using the Data - Text to columns function:

    Highlight the entire column.
    Click text to numbers
    Select "Delimited" and hit next.
    Uncheck all the delimiters and hit next
    Click General and then Advanced
    In the advanced box it asks for the decimals separator and for the thousands separator.
    Enter the separator you see on the screen (NOT the separator that you want). So in the above example you would put a comma as the thousands separator, and a full-stop as the decimal separator.
    click OK and finish.

    It works !!! - until the "text number" is in 1000's
    ie: R35,06 text converts to R35.06 number and
    R128,71 text converts to R128.71 number

    BUT -
    R4 020,40 text says as is and does not convert

  2. 238453758
    182121050
    180284560
    190244150
    219852959
    68828553
    42000000

    how to Change above string to numbers? thanks

  3. Hello All,

    I have data with 10 digit followed by X. I need a digit in place of X.

    Example: 0123456789X is the data and i need the output to be like 01234567890, 01234567891,.......0123456789

    • Hello!
      If I understand your task correctly, the following formula should work for you:

      ="0123456789"&SEQUENCE(100,1,0,1)

      You can learn more about SEQUENCE function in Excel in this article on our blog

      I hope it’ll be helpful.

  4. how do I convert all text strings to numbers in a column in Excel sheet
    'Php200.00
    'Php500.00
    'Php200.00
    'Php100.00
    'Php3,432.00
    Thank you.

    • Hello!
      If I understand your task correctly, the following formula should work for you:

      =--MID(SUBSTITUTE(A1,",",""),4,20)

      Hope this is what you need.

  5. Thanks.

  6. Thanks a lot

  7. none of these worked for me. I have just numbers copied from powerpoint into excel. I've used, trim, value, left, text to columns, and just simply changing it, and none of these are working.

  8. Grande! Thanks!

  9. 39.2 -90.1 I have two values but i keep to both values in two different column how to do?

  10. Hi!
    I work on spreadsheets daily, but all this needed info is tiresome!!
    I need a way where I can type minimum and it says it all...
    Like for instance: a column has different things like; interested, not interested, phone tomorrow, phone June, etc.
    Lazy me wants to connect each to a number and by pressing that number, it will say "Interested" or how ever it may be...
    I also need to know how to get the one column to add automatically say three days for follow-up call or to highlight the June call, that needs to be made, appear more urgent as we approach June, for instance...

    Any possible way to assist, please?

    Thank you kindly
    Annatjie

  11. How can I convert these numbers? I tried every suggestion above, but it did not work

    0.9587628865979382

  12. Hi. How do I get a column of written data selections (unlimited rows but 10 or 12 choices, eg different pathology types, to be converted to nunbers. Say, infection = 1, trauma = 2 etc.....

  13. I have a column of numbers that have an "AUD" reference at the end of each number. As a result it is not recognising them as numbers and I cannot tally the column. How do I remove the "AUD" reference from each cell to enable it to be added as numbers?

    • Hello!
      If I understand your task correctly, you can use SUBSTITUTE function to remove unnecessary text and extract number:

      =--SUBSTITUTE(A10,"AUD","")

      If you have other questions, don't hesitate to ask.

  14. Thank you so much

  15. thank you

  16. Great Article ....

  17. in excel if cell gets value of numer as text than
    Befor enting the value in cell use =ABS(cell number)

  18. use below view for more clarity
    .................................... Total
    1 20 0 10 20 20
    2 25 25 20 10 25
    3 15 25 8 40
    4 40 200 10 30 40
    5 10 100 20 10 110
    6 30 100 6 20 30
    7 5 100 10 10 5
    8 0 100 8 20 0
    9 20 100 8 20
    10 25 200 0 30 25

  19. I have to get total of each row in below. I used "auto sum " to get the result, but it gets wrong value for each raw. How can i fix this, pls. help
    Total
    1 20 0 10 20 20
    2 25 25 20 10 25
    3 15 25 8 40
    4 40 200 10 30 40
    5 10 100 20 10 110
    6 30 100 6 20 30
    7 5 100 10 10 5
    8 0 100 8 20 0
    9 20 100 8 20
    10 25 200 0 30 25

  20. How to convert 89000478513C,890004687210 to 8900100047851303,8900100046871010 respectively and so on

    • Hello!
      To replace a letter with its number in the alphabet, use the formula

      =CONCAT(IFERROR(IF(ISNUMBER(--MID(A1,ROW($1:$93),1)), MID(A1,ROW($1:$93),1), IF(CODE(MID(A1,ROW($1:$93),1))-64<=0, MID(A1,ROW($1:$93),1), CODE(MID(A1,ROW($1:$93),1))-64)),""),"")

      This is the formula for uppercase letters. If you need to replace lowercase letters, then instead of 64 use 96 in the formula

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 :)