Forum Discussion
Excel - problems converting string containing numbers and text to a number
- Jun 30, 2022
- LorenzoJun 24, 2022Silver Contributor
Hi Colin59
If you always have a B (MB, GB, TB, PB) as below
in B2:
=VALUE( SUBSTITUTE( LEFT(SUBSTITUTE(A2," ",""), SEARCH("?B",SUBSTITUTE(A2," ","")) -1), ".", "," ) )
If still not good please post a representative sample of your Text values
- Colin59Jun 28, 2022Copper Contributor
My Excel refused to accept your formula, even if I reduced it to a single line. :o(
I am stuck on Excel 16.43 (20110804) due to my OS not being upgradeable on this hardware. However, since the substitute commands work when they are applied individually to the column data I would have thought that formula should work. My three-extra-columns workaround does work though, it is just a trifle annoying.
- LorenzoJun 28, 2022Silver Contributor
Hi Colin59
I'm not a Mac user and have no idea at all what 16.43 means in term of Excel version (2010, 2013...2021 or 365). Just in case the VALUE function would not be avail. on 16.43 could you try the following?
=1*(SUBSTITUTE(LEFT(SUBSTITUTE(A2," ",""), SEARCH("?B",SUBSTITUTE(A2," ","")) -1),".", ","))