#1
|
|||
|
|||
Changing text to number format
I copied data from a table into Excel, and when I tried to multiply two numbers together, it results in "#VALUE!". I thought that probably means that the numbers are formatted as text, so I've tried:
However, I'm still getting the same #VALUE! result when I try to perform mathematical operations using this data. Any suggestions? Thanks, Mike |
#2
|
|||
|
|||
You might want to try (both numbers):
=TRIM(SUBSTITUTE(<cell>, CHAR(160),""))*1 |
#3
|
|||
|
|||
1. At start, select whole range where numeric values must be, and format the range as General or Number. NB! Setting the format doesn't convert any entries to numbers when they were text before, but it is a condition needed for all next steps to be successful;
2. When the numbers must have decimals, check, what is decimal delimiter in your Window settings, and compare this with your data (you can check this easily in some empty cell - enter the formula =1/2, and look at result. Is it 0.5 or 0,5. When all your data have decimal values and delimiter is different, a simple REPLACE operation over range with values to convert will do. When there are also integer values, then those cells remain text (but when you have wrong delimiter in datarange, then replacig it is MUST anyway; 3. Select some non-converted entry and look at it in formula field at top of sheet. When the entry is preceded with apostrophe (like '123), another REPLACE is needed (' with nothing). And I'm not entirely sure, but leading/trailing spaces or especially spaces entered between thousands groups may be also culprit - in this case REPALCE is also easiest to use; 4. And as last step (or second, when there was no need for steps 2 and 3), enter e.g. number 1 or 0 into some free cell, copy the cell (Ctrl+C), select the datarange, use PasteSpecial from right-click menu, and select then Multiply or Add (depending on the value you copied). Or select a cell, press F2, and then press Enter - for every cell in datarange. |
#4
|
|||
|
|||
That works. Thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Number Format Changing in DocVariable method | afshin | Word VBA | 3 | 08-06-2017 03:21 PM |
Number Format Changing in DocVariable method | afshin | Word | 0 | 08-02-2017 12:26 AM |
Changing caption number format | dpashley | Word | 1 | 05-02-2017 03:53 PM |
How to format a TOC (level 1) using a number, but have the number hidden in the text | porpoiseoil | Word | 1 | 09-13-2014 12:53 PM |
Cannot Convert Text Cell to number format to be able to sort the data | jyfuller | Excel | 10 | 06-19-2013 05:31 PM |