Thursday, 4 August 2011

Convert text to numbers in excel

Excel is nice (much better than word), but sometimes it drives me mad. Like today. I found a table with numbers on health expenses from 1946 until 2006 on a web page and wanted to use the numbers in some calculations. Copied the whole thing into excel. Everything works fine, except excel believes the numbers represent a text string. This is a common problem because the numbers had an initial space and a space as a thousand-delimiter. Now, there are some solutions (trim, clean and so on), but they did not work in this case. And just to make matters worse it is not possible in excel to search for a blank spaces and replace them with nothing. Annoying! Solution? Well copy the table to word, search and replace all spaces with nothing, copy the table back to excel. Voila!

No comments:

Post a Comment