Occasionally, numbers might be formatted and stored in cells as text, which later can cause problems with calculations or produce confusing sort orders. For example, you might have typed a number in a cell that was formatted as text, or the data may have been imported or copied as text from an external data source. Numbers that are formatted as text are left-aligned instead of right-aligned in the cell. If numbers are entered in cells that are formatted as text, you can use error checking to convert the numbers to text. If numbers are imported as text or if they are formatted as text after they were entered in cells, you cannot use error checking to convert the text to numbers. However, you can apply a number format instead. You can also quickly convert numbers that are formatted as text in multiple nonadjacent cells or ranges to numbers Use error checking to convert numbers that are stored as text to numbersWith Error Checking turned on, numbers that are entered in cells that are formatted as text are marked with an error indicator . - To turn on Error Checking, do the following:
- Click the Microsoft Office Button , and then click Excel Options.
- Click the Formulas category.
- Under Error Checking, make sure that the Enable background error checking check box is selected.
- Under Error checking rules, make sure that the Numbers formatted as text or preceded by an apostrophe check box is selected.
- Click OK.
- On the worksheet, select any single cell or range of adjacent cells that has an error indicator in the upper-left corner .
Note All cells in the selection must be adjacent. 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. To select the entire worksheet, you can also press CTRL+A. Note 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. Note 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. Row heading 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). Note 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 (active cell: The selected cell in which data is entered when you begin typing. Only one cell is active at a time. The active cell is bounded by a heavy border.) and the cell that you click becomes the new selection. |
Tip To cancel a selection of cells, click any cell on the worksheet.
- Next to the selected cell or range of cells, click the error button that appears , and then click Convert to Number.
Apply a number format to numbers that are stored as textFor this procedure to complete successfully, make sure that the numbers that are stored as text do not include extra spaces in or around the numbers. - 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. To select the entire worksheet, you can also press CTRL+A. Note 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. Note 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. Row heading 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). Note 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 (active cell: The selected cell in which data is entered when you begin typing. Only one cell is active at a time. The active cell is bounded by a heavy border.) and the cell that you click becomes the new selection. |
Tip To cancel a selection of cells, click any cell on the worksheet.
- On the Home tab, in the Number group, click the Dialog Box Launcher next to Number.
- In the Category box, click the number format that you want to use.
Convert numbers in multiple nonadjacent cells or ranges of cells- 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.
- In the cell, type 1, and then press ENTER.
- Select the cell and then, on the Home tab, in the Clipboard group, click Copy.
Keyboard shortcut You can also press CTRL+C. - Select the nonadjacent 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. To select the entire worksheet, you can also press CTRL+A. Note 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. Note 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. Row heading 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). Note 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 (active cell: The selected cell in which data is entered when you begin typing. Only one cell is active at a time. The active cell is bounded by a heavy border.) and the cell that you click becomes the new selection. |
Tip To cancel a selection of cells, click any cell on the worksheet.
- On the Home tab, in the Clipboard group, click the arrow below Paste, and then click Paste Special.
- Under Operation, select Multiply, and then click OK.
- 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.
Note 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 |
|