MS Excel: Convert a text to a number

What?
This is a quick article on how to convert some cells in Microsoft Excel to number values...

Why?
OMG. Seriously Microsoft! I have spent an hour trying to convert a column of currency values to a number using Microsoft Excel 2010. Since when did MS Excel stop understanding what a NUMBER was?

I have a column full of currency values which I want to convert, specifically Philippine pesos to British pounds (sterling). When I multiply the Philippine peso by the conversion rate, it returns #VALUE!

How?
The problem is that I have a column which includes the currency symbol as per the following image:

I create another column with the symbol omitted using the formula:
copyraw
=SUBSTITUTE(B3, "₱", "")
  1.  =SUBSTITUTE(B3, "₱", "") 



Which leaves the value as a literal string... Now the tricky part, how to copy into a column just the number? Even if I tell it to multiply by 1, Microsoft Excel gets confused and reports an error?!?!?!?



The answer on the Microsoft website is as helpful as the Microsoft paperclip, in other words, not worth the time or effort to try (didn't work anyway). The TRIM() function will not work for you either, nor with the VALUE() function....

The culprit was a suspicious space which had been copied in between the currency amount and the currency symbol. Microsoft could argue this is a problem with your data but the way I see it is it's a space character and TRIM() should work.

My solution
Include the space (if there is one) in the substitute formula:
copyraw
=SUBSTITUTE(B3, " ₱", "")
  1.  =SUBSTITUTE(B3, " ₱", "") 



The resulting value will still need to be multiplied by 1 to convert to a number but what a palava!
Category: Excel :: Article: 535

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.