Article ID: 291047 - Last Review: September 18, 2011 - Revision: 7.0 How to convert text to numbers in Excel 2002 and in Excel 2003
This article was previously published under Q291047 On This PageSUMMARY This step-by-step article describes how to convert cells
that contain text to cells that contain numbers. convert cells that contain
text to cells that contain numbers. When you import a file that was created in another program (such as dBASE or Lotus 1-2-3) or was downloaded from a mainframe, Microsoft Excel may recognize some numbers as text. This causes functions such as SUM and AVERAGE to ignore the values in these cells. These text strings may contain actual text in addition to the numbers that you want to convert. Converting Text to NumbersTo convert text to numbers in a worksheet, use any of the methods described later in this article (methods 1 through 7).Note Each of these methods assumes that you have already changed any cell number formatting in the cells to General. To do this, follow these steps:
Method 1: Use the Error ButtonIf the cells in which numbers are displayed as text contain an error indicator in the upper-left corner, follow these steps:
Method 2: Retype the Values in the CellsTo retype the values in the cells, follow these steps:
Method 3: Edit Directly in the CellTo edit directly in the cells, follow these steps:
Method 4: Use the Paste Special CommandTo use the Paste Special command, follow these steps:
Method 5: Remove Hidden Characters and SpacesThis method works best if the data is arranged in a single column or row. This method uses the TRIM function and the CLEAN function to remove extra spaces and nonprinting characters that may be imported with the file. The following example assumes that the data is in column A and starts in row 1 ($A$1). To use this example, follow these steps:
Note This method may not remove all nonprinting whitespace characters. For example, the whitespace character Chr$(160) will not be removed. Method 6: Use a Visual Basic for Applications ProcedureMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Create a Visual Basic for Applications macro to reenter the numbers in the selected cell or range of cells. To do this, follow these steps:
Method 7: Use the Text to Columns CommandThis method works best if the data is arranged in a single column. The following example assumes that the data is in column A and starts in row 1 ($A$1). To use this example, follow these steps:
REFERENCES
For more information about cell formatting, click Microsoft Excel Help on the Help menu, type format cells in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products. | Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top