Is there a way to convert a time in the format mm.ss into mm:ss?
For example, I have an entire column going down:
12.37,
1.34,
5.36
I want it to say:
00:12:37,
00:01:34,
00:05:36
I've tried using the find/replace tool on Excel, but since the values are formatted as "number" rather than duration, changing them ends up changing it into some kind of larger value.
Is there a way to just replace . to : and turn my numbers into a duration format?
Thanks!
use:
=--("00:"&SUBSTITUTE(A1,".",":"))
Then format the output as hh:mm:ss
Related
I want to subtract the time in text format
like: 10.51 - 2.15 (means 10hrs 51min - 2hrs 15min)
Now I using Min-Min and then convert to Hrs in text format, but have any wonderful code that I no need convert to Min? just Hrs-Hrs.
=CONCATENATE(INT((textMin)/60),".",MOD(INT(textMin),60))
I don't use time format or ":" because have a lot data to key in, number pad is good for key in much data.
Thanks a lot!
Several ways to approach this.
Use Find and Replace to replace . with :, then use simple subtraction
leave the data as you input it and use a formula to convert the decimals into time values
=TIME(INT(A1),MOD(A1,1)*100,0)-TIME(INT(B1),MOD(B1,1)*100,0)
like here:
Or use
=SUBSTITUTE(A1,".",":")-SUBSTITUTE(B1,".",":")
I'm trying to convert a string to a time format in excel. The data is displayed as 2m 51s, 0m 4s, and so on. I'd like to convert this into 2:51 and so on and also would like to be able to pivot the data using those numbers as values. I tried a simple find and replace to remove the m and s and add in a : but it doesn't work when I need to pivot the data as Excel considers that as a date.
You can use
=TIME(0,LEFT(A1,(FIND("m",A1,1)-1)),MID(LEFT(A1,FIND("s",A1)-1),FIND("m",A1)+1,LEN(A1)))
Depending on your settings it may give you an AM/M time but you can change the cell formatting to 'Time' to get 00:02:51.
With data in E1, in F1 enter:
=TIMEVALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("00:" & E1," ",""),"m",":"),"s",""))
and apply proper formatting:
The formula takes a string like:
1m 51s
and converts it into:
0:1:51
this is then processed by the TIMEVALUE() function.
I have a range of data which are in a time format of hh:mm.ss (my original dataset is imported through a csv this way). I need to transform it to a correct format (hh:mm:ss) to make calculations and that's easily done using the replace functionality.
The issue is that some of these data don't have the hh part, they are just mm.ss, so when I replace "." with ":" they become hh:mm instead of mm:ss, e.g. 06m.30s becomes 06h:30m.
Does anyone know how to make a custom time format that will take as default value the mm and include the hh only when necessary?
This assumes that during the import process, the time column is imported as TEXT
EDIT: Formula shortened.
Convert the values to a REAL Excel time
=TIMEVALUE(SUBSTITUTE(IF(ISERR(FIND(":",A2)),"00:"&A2,A2),".",":"))
or
=--(SUBSTITUTE(IF(ISERR(FIND(":",A2)),"00:"&A2,A2),".",":"))
Apply your desired Time format to the result
hh:mm:ss
I Received excel data with following format
Date format YYYY-MM-DD+11:00 (Ex 2014-02-15+11:00 /2014-02-18+13:00)
Now I need to convert into this format
2014-02-18 HH:MM:SI
Please help me to do this
cheers
Just did a quick test. It's a little sloppy, but this formula will work. For the sake of argument, it assumes that the data you're trying to convert is in A1 of the current sheet, that it's all the same length, and that the format is "General":
=SUM(DATEVALUE(LEFT(A1,10)),TIMEVALUE(RIGHT(A1,5)))
Wherever you use the above formula, change the format to the Custom Format YYYY-MM-DD HH:MM:SI. I'm not sure what you're looking for with SI. I'm taking that literally. That custom format will display the seconds value and then the letter I. If you're looking for a different value, like milliseconds, then you can look that up. But if the data you're converting is in a "General" format, when you convert it, it won't have seconds or milliseconds, anyway. Those will all get converted to 00s.
A reporting service generates a csv file and certain columns (oddly enough) have mixed date/time format , some rows contain datetime expressed as m/d/y, others as d.m.y
When applying =TYPE() it will either return 1 or 2 (Excel will recognize either a text or a number (the Excel timestamp))
How can I convert any kind of wrong date-time format into a "normal" format that can be used and ensure some consistency of data?
I am thinking of 2 solutions at this moment :
i should somehow process the odd data with existing excel functions
i should ask the report to be generated correctly from the very beginning and avoid this hassle in the first place
Thanks
Certainly your second option is the way to go in the medium-to-long term. But if you need a solution now, and if you have access to a text editor that supports Perl-compatible regular expressions (like Notepad++, UltraEdit, EditPad Pro etc.), you can use the following regex:
(^|,)([0-9]+)/([0-9]+)/([0-9]+)(?=,|$)
to search for all dates in the format m/d/y, surrounded by commas (or at the start/end of the line).
Replace that with
\1\3.\2.\4
and you'll get the dates in the format d.m.y.
If you can't get the data changed then you may have to resort to another column that translates the dates: (assumes date you want to change is in A1)
=IF(ISERR(DATEVALUE(A1)),DATE(VALUE(RIGHT(A1,LEN(A1)-FIND(".",A1,4))),VALUE(MID(A1,FIND(".",A1)+1,2)),VALUE(LEFT(A1,FIND(".",A1)-1))),DATEVALUE(A1))
it tests to see if it can read the text as a date, if it fails, then it will chop up the string, and convert it to a date, else it will attempt to read the date directly. Either way, it should convert it to a date you can use