I would like to add group separator to a column of texts with numbers in it,
e.g. from 78898 (30.18%) to 78,898 (30.18%)
but the NUMBERVALUE function didn't work.
And if convert using the "text to columns", then (30.18%) will be converted to -30.18%.
How can I do to achieve that?
Thanks!
With data in A1, in B1 enter:
=TEXT(--LEFT(A1,FIND(" ",A1)-1),"#,##0") & MID(A1,FIND(" ",A1),9999)
We:
parse the string
convert the leading part to a number
format the number
re-assemble the string
Related
I have cells that look like this: 1000 (1.0) and I would like to format the first part of the cell with commas separating the thousands, i.e 1,000 (1.0).
I've tried using the text function in a formula i.e. =text(A1,"0,000") or =text(A1,"#,###") but this didn't add a comma.
Excel sees the cell as a text string and as such it cannot be formatted. You need to parse the string and put it back together:
=TEXT(LEFT(A1,FIND("(",A1)-1),"#,##0") & " " & MID(A1,FIND("(",A1),20)
I have time entries of the form:
12:45:55:346 (hh:mm:ss:mss)
And I want to convert it to the form:
12:45:55,346 (hh:mm:ss,mss)
How shall I proceed, please?
You can use the SUBSTITUTE function and specify the 4th parameter:
With input in A1:
=SUBSTITUTE(A1,":",",",3)
With data in A1, in B1 enter:
=LEFT(A1,LEN(A1)-4) & "," & RIGHT(A1,3)
This formula will do the trick:
=REPLACE(A1, 9, 1, ",")
Although this is not something I'd exactly recommend and is likely to
mess up your formatting.
If you truly insist on using this formatting, then keep the original data in a hidden column and do all the calculations with it. The data in this format should just be used to display the current / final result(s).
I have two cells in my excel sheet, where I compare them against each other.
Now, it's a long sheet, and I have formatted all the date cells to "Short Date". However, some dates are entered like below:
'02-02-2015
And others are entered without the ':
02-02-2015
Now, the problem is when I compare those two dates above - it doesn't give me the correct result, because of the " ' "
How can I "strip" all the date fields to not use the apostrophe in front?
Thanks.
You can try converting both to one type when comparing them
, e.g. TEXT
Example
=IF(TEXT(A1;)=TEXT(B1;);1;0)
Use Replace
Example:
Dim D As Date: D = Replace("'20-01-2015", "'", "")
With data in column A, in B1 enter:
=IF(LEFT(A1,1)="'",MID(A1,2,9999),A1)
and copy down. For example:
I have a cell with the contents of 41316. I have it formatted as 20130211.
I need another cell to reference that value, but in the cell have it showing as 20130211 not 41316 formatted.
This maybe an easy one, but for some reason it has me running in circles.
Thanks in advance for all responses.
Excel by default copies the format from a cell formatted as a date to a cell which references it. It sounds in your case that Excel hasn't done that for you, so you just need to format the new cell with your special format : paintbrush tool or Edit..Copy, Edit..Past Special..Formats or Format..Number..Custom and select your format, which will be at the bottom of a long list.
If a string is ok instead of a number, you can decompose that date in parts and concatenate:
Being A1 the cell containing the value:
= Year(A1) & "/" & Month(A1) & "/" & Day(A1)
The "&" symbol concatenates text. The slashes are optional if you want them separated by slashes.
if your cell referencing 20130211 is 'A1' put =TEXT(A1,"####") in your calculation cell. If you do it this way then it will still read as a number and not a string
I have imported some dates into an excel document and I need to format them as dates not text strings.
The format is like this: 12.05.79 but when I set the format to date excel doesn't do anything.
Any way to do this?
C
Two possible ways to convert "in situ" without an extra column
1 - use "Text to columns"
Select column of dates then Data > text to columns > Next > Next > "under column data format" select "Date" and the format from dropdown (MDY or DMY) > OK
2 - use Edit/Replace. Replace "." with "/" (in both cases without quotes)
Changing the format doesn't change the value (or in this case text). You'll have to use a macro, or just use a helper column with the following formula. You can then copy / paste values and remove the first column
=DATEVALUE(SUBSTITUTE(A1,".","/"))