Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

In some cases, numbers in a worksheet are actually formatted and stored in cells as text, which can cause problems with calculations or produce confusing sort orders. This issue sometimes occurs after you import or copy data from a database or other external data source.

Numbers that are formatted as text are left-aligned instead of right-aligned in the cell, and are often marked with an error indicator.

What do you want to do?

Technique 1: Convert text-formatted numbers by using Error Checking

If you import data into Excel from another source, or if you type numbers into cells that were previously formatted as text, you may see a small green triangle in the upper-left corner of the cell. This error indicator tells you that the number is stored as text, as shown in this example.

Cells with green error indicator in upper-left corner

If this isn't what you want, you can follow these steps to convert the number that is stored as text back to a regular number.

  1. On the worksheet, select any single cell or range of cells that has an error indicator in the upper-left corner.

    How to select cells, ranges, rows, or columns

    To select

    Do this

    A single cell

    Click the cell, or press the arrow keys to move to the cell.

    A range of cells

    Click the first cell in the range, and then drag to the last cell, or hold down Shift while you press the arrow keys to extend the selection.

    You can also select the first cell in the range, and then press F8 to extend the selection by using the arrow keys. To stop extending the selection, press F8 again.

    A large range of cells

    Click the first cell in the range, and then hold down Shift while you click the last cell in the range. You can scroll to make the last cell visible.

    All cells on a worksheet

    Click the Select All button.

    Select All button

    To select the entire worksheet, you can also press Ctrl+A.

    If the worksheet contains data, Ctrl+A selects the current region. Pressing Ctrl+A a second time selects the entire worksheet.

    Nonadjacent cells or cell ranges

    Select the first cell or range of cells, and then hold down Ctrl while you select the other cells or ranges.

    You can also select the first cell or range of cells, and then press Shift+F8 to add another nonadjacent cell or range to the selection. To stop adding cells or ranges to the selection, press Shift+F8 again.

    You cannot cancel the selection of a cell or range of cells in a nonadjacent selection without canceling the entire selection.

    An entire row or column

    Click the row or column heading.

    Worksheet headings

    1. Row heading

    2. Column heading

    You can also select cells in a row or column by selecting the first cell and then pressing Ctrl+Shift+Arrow key (Right Arrow or Left Arrow for rows, Up Arrow or Down Arrow for columns).

    If the row or column contains data, Ctrl+Shift+Arrow key selects the row or column to the last used cell. Pressing Ctrl+Shift+Arrow key a second time selects the entire row or column.

    Adjacent rows or columns

    Drag across the row or column headings. Or select the first row or column; then hold down Shift while you select the last row or column.

    Nonadjacent rows or columns

    Click the column or row heading of the first row or column in your selection; then hold down Ctrl while you click the column or row headings of other rows or columns that you want to add to the selection.

    The first or last cell in a row or column

    Select a cell in the row or column, and then press Ctrl+Arrow key (Right Arrow or Left Arrow for rows, Up Arrow or Down Arrow for columns).

    The first or last cell on a worksheet or in a Microsoft Office Excel table

    Press Ctrl+Home to select the first cell on the worksheet or in an Excel list.

    Press Ctrl+End to select the last cell on the worksheet or in an Excel list that contains data or formatting.

    Cells to the last used cell on the worksheet (lower-right corner)

    Select the first cell, and then press Ctrl+Shift+End to extend the selection of cells to the last used cell on the worksheet (lower-right corner).

    Cells to the beginning of the worksheet

    Select the first cell, and then press Ctrl+Shift+Home to extend the selection of cells to the beginning of the worksheet.

    More or fewer cells than the active selection

    Hold down Shift while you click the last cell that you want to include in the new selection. The rectangular range between the active cell and the cell that you click becomes the new selection.

    To cancel a selection of cells, click any cell on the worksheet.

  2. Next to the selected cell or range of cells, click the error button that appears.

    Error button

  3. On the menu, click Convert to Number. (If you want to simply get rid of the error indicator without converting the number, click Ignore Error.)

    Convert to Number command

    This action converts the numbers that are stored as text back to numbers.

    Converted numbers

    Once you have converted the numbers formatted as text into regular numbers, you can change the way the numbers appear in the cells by applying or customizing a number format. For more information, see Available number formats.

Top of Page

Technique 2: Convert text-formatted numbers by using Paste Special

In this technique, you multiply each selected cell by 1 in order to force the conversion from a text-formatted number to a regular number. Because you're multiplying the contents of the cell by 1, the result in the cell looks identical. However, Excel actually replaces the text-based contents of the cell with a numerical equivalent.

  1. Select a blank cell and verify that its number format is General.

    How to verify the number format

    • On the Home tab, in the Number group, click the arrow next to the Number Format box, and then click General.

      Excel  Ribbon Image

  2. In the cell, type 1, and then press ENTER.

  3. Select the cell, and then press Ctrl+C to copy the value to the Clipboard.

  4. Select the cells or ranges of cells that contain the numbers stored as text that you want to convert.

    How to select cells, ranges, rows, or columns

    To select

    Do this

    A single cell

    Click the cell, or press the arrow keys to move to the cell.

    A range of cells

    Click the first cell in the range, and then drag to the last cell, or hold down Shift while you press the arrow keys to extend the selection.

    You can also select the first cell in the range, and then press F8 to extend the selection by using the arrow keys. To stop extending the selection, press F8 again.

    A large range of cells

    Click the first cell in the range, and then hold down Shift while you click the last cell in the range. You can scroll to make the last cell visible.

    All cells on a worksheet

    Click the Select All button.

    Select All button

    To select the entire worksheet, you can also press Ctrl+A.

    If the worksheet contains data, Ctrl+A selects the current region. Pressing Ctrl+A a second time selects the entire worksheet.

    Nonadjacent cells or cell ranges

    Select the first cell or range of cells, and then hold down Ctrl while you select the other cells or ranges.

    You can also select the first cell or range of cells, and then press Shift+F8 to add another nonadjacent cell or range to the selection. To stop adding cells or ranges to the selection, press Shift+F8 again.

    You cannot cancel the selection of a cell or range of cells in a nonadjacent selection without canceling the entire selection.

    An entire row or column

    Click the row or column heading.

    Worksheet headings

    1. Row heading

    2. Column heading

    You can also select cells in a row or column by selecting the first cell and then pressing Ctrl+Shift+Arrow key (Right Arrow or Left Arrow for rows, Up Arrow or Down Arrow for columns).

    If the row or column contains data, Ctrl+Shift+Arrow key selects the row or column to the last used cell. Pressing Ctrl+Shift+Arrow key a second time selects the entire row or column.

    Adjacent rows or columns

    Drag across the row or column headings. Or select the first row or column; then hold down Shift while you select the last row or column.

    Nonadjacent rows or columns

    Click the column or row heading of the first row or column in your selection; then hold down Ctrl while you click the column or row headings of other rows or columns that you want to add to the selection.

    The first or last cell in a row or column

    Select a cell in the row or column, and then press Ctrl+Arrow key (Right Arrow or Left Arrow for rows, Up Arrow or Down Arrow for columns).

    The first or last cell on a worksheet or in a Microsoft Office Excel table

    Press Ctrl+Home to select the first cell on the worksheet or in an Excel list.

    Press Ctrl+End to select the last cell on the worksheet or in an Excel list that contains data or formatting.

    Cells to the last used cell on the worksheet (lower-right corner)

    Select the first cell, and then press Ctrl+Shift+End to extend the selection of cells to the last used cell on the worksheet (lower-right corner).

    Cells to the beginning of the worksheet

    Select the first cell, and then press Ctrl+Shift+Home to extend the selection of cells to the beginning of the worksheet.

    More or fewer cells than the active selection

    Hold down Shift while you click the last cell that you want to include in the new selection. The rectangular range between the active cell and the cell that you click becomes the new selection.

    To cancel a selection of cells, click any cell on the worksheet.

  5. On the Home tab, in the Clipboard group, click the arrow below Paste, and then click Paste Special.

  6. Under Operation, select Multiply, and then click OK.

  7. To delete the content of the cell that you typed in step 2 after all numbers have been converted successfully, select that cell, and then press DELETE.

Some accounting programs display negative values as text, with the negative sign () to the right of the value. To convert the text string to a value, you must use a formula to return all the characters of the text string except the rightmost character (the negation sign), and then multiply the result by –1.

For example, if the value in cell A2 is "156–" the following formula converts the text to the value –156.

Data

Formula

156-

=Left(A2,LEN(A2)-1)*-1

Top of Page

Technique 3: Apply a number format to text-formatted numbers

In some scenarios, you don't have to convert numbers stored as text back to numbers, as described earlier in this article. Instead, you can just apply a number format to achieve the same result. For example, if you enter numbers in a workbook, and then format those numbers as text, you won't see a green error indicator appear in the upper-left corner of the cell. In this case, you can apply number formatting.

  1. Select the cells that contain the numbers that are stored as text.

    How to select cells, ranges, rows, or columns

    To select

    Do this

    A single cell

    Click the cell, or press the arrow keys to move to the cell.

    A range of cells

    Click the first cell in the range, and then drag to the last cell, or hold down Shift while you press the arrow keys to extend the selection.

    You can also select the first cell in the range, and then press F8 to extend the selection by using the arrow keys. To stop extending the selection, press F8 again.

    A large range of cells

    Click the first cell in the range, and then hold down Shift while you click the last cell in the range. You can scroll to make the last cell visible.

    All cells on a worksheet

    Click the Select All button.

    Select All button

    To select the entire worksheet, you can also press Ctrl+A.

    If the worksheet contains data, Ctrl+A selects the current region. Pressing Ctrl+A a second time selects the entire worksheet.

    Nonadjacent cells or cell ranges

    Select the first cell or range of cells, and then hold down Ctrl while you select the other cells or ranges.

    You can also select the first cell or range of cells, and then press Shift+F8 to add another nonadjacent cell or range to the selection. To stop adding cells or ranges to the selection, press Shift+F8 again.

    You cannot cancel the selection of a cell or range of cells in a nonadjacent selection without canceling the entire selection.

    An entire row or column

    Click the row or column heading.

    Worksheet headings

    1. Row heading

    2. Column heading

    You can also select cells in a row or column by selecting the first cell and then pressing Ctrl+Shift+Arrow key (Right Arrow or Left Arrow for rows, Up Arrow or Down Arrow for columns).

    If the row or column contains data, Ctrl+Shift+Arrow key selects the row or column to the last used cell. Pressing Ctrl+Shift+Arrow key a second time selects the entire row or column.

    Adjacent rows or columns

    Drag across the row or column headings. Or select the first row or column; then hold down Shift while you select the last row or column.

    Nonadjacent rows or columns

    Click the column or row heading of the first row or column in your selection; then hold down Ctrl while you click the column or row headings of other rows or columns that you want to add to the selection.

    The first or last cell in a row or column

    Select a cell in the row or column, and then press Ctrl+Arrow key (Right Arrow or Left Arrow for rows, Up Arrow or Down Arrow for columns).

    The first or last cell on a worksheet or in a Microsoft Office Excel table

    Press Ctrl+Home to select the first cell on the worksheet or in an Excel list.

    Press Ctrl+End to select the last cell on the worksheet or in an Excel list that contains data or formatting.

    Cells to the last used cell on the worksheet (lower-right corner)

    Select the first cell, and then press Ctrl+Shift+End to extend the selection of cells to the last used cell on the worksheet (lower-right corner).

    Cells to the beginning of the worksheet

    Select the first cell, and then press Ctrl+Shift+Home to extend the selection of cells to the beginning of the worksheet.

    More or fewer cells than the active selection

    Hold down Shift while you click the last cell that you want to include in the new selection. The rectangular range between the active cell and the cell that you click becomes the new selection.

    To cancel a selection of cells, click any cell on the worksheet.

  2. On the Home tab, in the Number group, click the Dialog Box Launcher next to Number.

    Dialog Box Launcher in Number group

  3. In the Category box, click the number format that you want to use.

    For this procedure to complete successfully, make sure that the numbers that are stored as text do not include extra spaces or nonprintable characters in or around the numbers. The extra spaces or characters sometimes occur when you copy or import data from a database or other external source. To remove extra spaces from multiple numbers that are stored as text, you can use the TRIM function or CLEAN function. The TRIM function removes spaces from text except for single spaces between words. The CLEAN function removes all nonprintable characters from text.

Top of Page

Turn off Error Checking

With error checking turned on in Excel, you see a small green triangle if you enter a number into a cell that has text formatting applied to it. If you don’t want to see these error indicators, you can turn them off.

  1. Click the File tab.

  2. Under Help, click Options.

  3. In the Excel Options dialog box, click the Formulas category.

  4. Under Error checking rules, clear the Numbers formatted as text or preceded by an apostrophe check box.

  5. Click OK.

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×