Science, Tech, Math › Computer Science Convert Text to Number in Excel Use VBA in Excel 2003 and Excel 2007 to Convert Text Cells to Numbers Share Flipboard Email Print Microsoft/Public Domain Computer Science Visual Basic PHP Programming Perl Python Java Programming Javascript Programming Delphi Programming C & C++ Programming Ruby Programming View More By Dan Mabbutt Dan Mabbutt Computer Science Expert B.S., Computer Science, University of Utah Dan Mabbutt is a Visual Basic expert who created training courses for Visual Basic users. He co-authored two books on the subject. Learn about our Editorial Process Updated on March 18, 2017 Question: How do I convert cells filled with character numbers to numeric values so I can use the values in Excel math formulas. I recently had to add a column of numbers in Excel that were copied and pasted from a table in a web page. Because the numbers are represented by text in the web page (that is, the number "10" is actually "Hex 3130"), a Sum function for the column simply results in a zero value. You can find a lot of web pages (including Microsoft pages) that simply give you advice that doesn't work. For example, this page ... http://support.microsoft.com/kb/291047 ... gives you seven methods. The only one that actually works is to retype the value manually. (Gee, thanks, Microsoft. I never would have thought of that.) The most common solution I found on other pages is to Copy the cells and then use Paste Special to paste the Value. That doesn't work either. (Tested on Excel 2003 and Excel 2007.) The Microsoft page provides a VBA Macro to do the job ("Method 6"): Sub Enter_Values() For Each xCell In Selection xCell.Value = xCell.Value Next xCell End Sub It doesn't work either, but all you have to do is make one change and it does work: For Each xCell In Selection xCell.Value = CDec(xCell.Value) Next xCell It's not rocket science. I can't understand why so many pages have it wrong. Cite this Article Format mla apa chicago Your Citation Mabbutt, Dan. "Convert Text to Number in Excel." ThoughtCo, Aug. 26, 2020, thoughtco.com/convert-text-to-number-in-excel-3424223. Mabbutt, Dan. (2020, August 26). Convert Text to Number in Excel. Retrieved from https://www.thoughtco.com/convert-text-to-number-in-excel-3424223 Mabbutt, Dan. "Convert Text to Number in Excel." ThoughtCo. https://www.thoughtco.com/convert-text-to-number-in-excel-3424223 (accessed April 1, 2023). copy citation