Convert Text to a Number in Excel

If your spreadsheet contains text representations of numbers, rather than actual numeric values, this may produce errors when you try to use these values in calculations. Therefore, this page describes four different methods that can be used to convert text to numbers.

Excel Convert Text to Number Index:
Text to Number Using Error Checking
Text to Number Using Text to Columns
Text to Number Using Paste Special
Text to Number Using Excel Functions

Convert Text to a Number Using Excel Error Checking

Excel has an error checking option that can alert you to the presence of cells containing text representations of numbers. This will be seen as a small colored triangle (the error indicator) in the top left corner of your cells (see below).

Error Indicators in Cells Containing Numbers Stored as Text

If your cells display this error indicator, you can use Excel error checking to convert text representations of numbers into actual numeric values.

To do this:

  1. Select the cell (or cells) containing the values that you want to convert.

    This will cause a warning symbol to pop up at the side of the cell(s). If you then hover over the warning symbol, a warning message is displayed (see below).

    Error Checking Warning Message Informing of Number Stored as Text
  2. Error Checking Menu for Number Stored as Text

    Click on the warning symbol, to bring up the Error Checking menu (see rightabove).

    Select the Convert to Number option to convert the cell values into numbers.

Error Checking Option

In order for the above method to work, you need to ensure that you have the Excel Error Checking option for numbers stored as text enabled.

To access this option:

  1. Click on the File tab (or the Microsoft Office Button in Excel 2007), and select Options.
  2. Within the Excel Options window, select Formulas.
  3. Within the Error Checking section, make sure the option Enable background error checking is checked.
  4. Within the Error checking rules section, make sure the option Numbers formatted as text or preceded by an apostrophe is checked.
  5. Click OK.

Convert Text to a Number Using Excel Text to Columns

The Excel Text to Columns command will also convert between Excel data types. However, this command will only work on one column at a time.

To use Excel Text to Columns to convert text to numbers:

  1. Select the cell(s) that you want to convert (these must all be in the same column).
  2. Excel Text To Columns Option Button

    From the Data tab on the Excel ribbon, select the Text to Columns option (see rightabove).

    This will cause the Convert Text to Columns wizard to pop up. Within this:

    • Make sure the Delimited option is selected and click Next >;
    • Make sure that none of the Delimiters are selected and then click Next > again;
    • You should now be offered a selection of Column Data Formats. Select General and click the Finish button.

      Excel Text To Columns Wizard Step 3 with General Data Format Selected


Convert Text to a Number Using Excel Paste Special

You can also use the Excel Paste Special command to convert text to numbers in a range of Excel cells.

The method described below adds the value zero to each cell in the selected range. This procedure converts text representations of numbers into numeric values, but leaves any cells containing non-numeric text unchanged.

To do this:

  1. Type a zero into any spare cell in your spreadsheet.
  2. Select the cell containing the zero and copy this cell (the easiest way is to use the keyboard shortcut, CTRL-C).
  3. Select the cells containing the text that you want to convert to numbers.
  4. Excel Paste Special Option

    From the Home tab of the Excel ribbon, select the option Paste → Paste Special (see rightabove).

    Note that the keyboard shortcut for this is CTRL-ALT-V.

    This will cause the Paste Special Dialog box to pop up, as shown below.

    Excel Paste Special Option
  5. Within the Paste Special dialog box, select the Add Operation and click OK.


Convert Text to a Number Using the Excel Value Function

The Excel Value function converts a text value into a number. This might be useful if you want to extract the numeric values from a more complicated text string.

Value Function Examples

Example 1

Column A of the spreadsheets below contain text representations of numbers. The Excel Value function is used in column B of the spreadsheet, to convert the text values into numbers.

 Formulas:
 AB
1111=VALUE( A1 )
2112=VALUE( A2 )
3113=VALUE( A3 )
4114=VALUE( A4 )
5115=VALUE( A5 )
 Results:
 AB
1111111
2112112
3113113
4114114
5115115

Example 2

In the spreadsheet below, the Excel Value function is used in combination with the Excel Left function, to extract the numeric value from the text string in cell A1 of the spreadsheet.

 Formulas:
 AB
131 days this month=VALUE( LEFT( A1,2 ) )
 Results:
 AB
131 days this month31

Note that, if the text argument that is supplied to the Value function cannot be interpreted as a numeric value, the function returns the #VALUE! error.


Methods of Converting Excel Text to Numbers are discussed further on the Microsoft Office Support website.

Continue to the Convert Number To Text page  >>