Convert numbers stored as text to numbers Office 2007

Author: mety Labels::

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 numbers

With Error Checking turned on, numbers that are entered in cells that are formatted as text are marked with an error indicator Cell with formula problem.

  1. To turn on Error Checking, do the following:
    1. Click the Microsoft Office Button Button image, and then click Excel Options.
    2. Click the Formulas category.
    3. Under Error Checking, make sure that the Enable background error checking check box is selected.
    4. Under Error checking rules, make sure that the Numbers formatted as text or preceded by an apostrophe check box is selected.
    5. Click OK.
  2. On the worksheet, select any single cell or range of adjacent cells that has an error indicator in the upper-left corner Cell with formula problem .

    Note All cells in the selection must be adjacent.

    ShowHow to select cells, ranges, rows, or columns

    To selectDo this
    A single cellClick the cell, or press the arrow keys to move to the cell.
    A range of cellsClick 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 cellsClick 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 worksheetClick the Select All button.

    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 rangesSelect 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 columnClick the row or column heading.

    Worksheet showing row heading and column heading

    Callout 1 Row heading
    Callout 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).

    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 columnsDrag 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 columnsClick 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 columnSelect 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 tablePress 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 worksheetSelect 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 selectionHold 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.


  3. Next to the selected cell or range of cells, click the error button that appears Button image, and then click Convert to Number.

Apply a number format to numbers that are stored as text

For 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.

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

    ShowHow to select cells, ranges, rows, or columns

    To selectDo this
    A single cellClick the cell, or press the arrow keys to move to the cell.
    A range of cellsClick 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 cellsClick 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 worksheetClick the Select All button.

    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 rangesSelect 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 columnClick the row or column heading.

    Worksheet showing row heading and column heading

    Callout 1 Row heading
    Callout 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).

    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 columnsDrag 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 columnsClick 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 columnSelect 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 tablePress 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 worksheetSelect 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 selectionHold 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.


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

    Excel Ribbon Image

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

Convert numbers in multiple nonadjacent cells or ranges of cells

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

    ShowHow 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, on the Home tab, in the Clipboard group, click Copy.

    Excel Ribbon Image

    Keyboard shortcut You can also press CTRL+C.

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

    ShowHow to select cells, ranges, rows, or columns

    To selectDo this
    A single cellClick the cell, or press the arrow keys to move to the cell.
    A range of cellsClick 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 cellsClick 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 worksheetClick the Select All button.

    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 rangesSelect 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 columnClick the row or column heading.

    Worksheet showing row heading and column heading

    Callout 1 Row heading
    Callout 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).

    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 columnsDrag 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 columnsClick 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 columnSelect 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 tablePress 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 worksheetSelect 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 selectionHold 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.


  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.

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.

DataFormula
156-=LEFT(A2,LEN(A2)-1)*-1

0 comments |

Labels

Blog Archive

Powered by Blogger.

I made these pages for me and my friends to help solving the problem we face regarding Computer & internet, if anyone wants me to answer a question or find out about some information please send me email and I will try to reply.*P.S. some of the article I wrote and the other I found on the internet I posted them in sprit of learning and shearing, please forgive me if you found something you don’t want to be in my blog, email me and I will delete them. Thank you for your interest in my pages.امل نجم Amal Nagm

banner 1 banner 2