Excel time conversion from words - excel

I was sent a spread sheet and it listed the times as "00 hours 04 minutes 44 seconds" how do i convert 00 hours 04 minutes 44 seconds into a regular time like 04:44 in excel?

Try this, assuming your data is in cell A1:
=RIGHT(LEFT(A1, FIND("hours", A1)-2), 2)&":"&RIGHT(LEFT(A1, FIND("minutes", A1)-2), 2)&":"&RIGHT(LEFT(A1, FIND("seconds", A1)-2), 2)
You can see what each individual piece is doing if you split it apart at the &. For example, =RIGHT(LEFT(A1, FIND("minutes", A1)-2), 2) returns "04". One level in from that, LEFT(A1, FIND("minutes", A1)-2) returns "00 hours 04", and you need the right two characters of that.
This should work regardless of what order the hours, minutes, and seconds are in.

The CGritton's solution shows the time as text (you can not change the format or do some calculation with it).
If all cells have the same format ## hours ## minutes ## seconds you can simplify the formula.
Assuming that you have "00 hours 04 minutes 44 seconds" in cell B4, just type, for example in cell D4:
=TIME(LEFT(B4,2),MID(B4,10,2),MID(B4,21,2))
Then you can change the format to: hh:mm:ss AM/PM or hh:mm AM/pm or hh:mm

Related

In Excel I need to convert seconds in days hours min sec

I've already figure out that I can divide the number of seconds/86400 and then use the format: dd \d\a\y\s hh:mm:ss, but when it goes over 31 days 23:59:59, the number of days goes back to 0.
How can I keep on going with the days (like 32 days 00:00:01)?
Thank you
---- Adding more ---
I forgot to mention that I'm trying to do it in a Pivot table and I have not been able to figure out how to use text in it...
I've also found the following format but it won't give me a 00 in the month:
Nb of seconds: 13670
Format : yy \y\e\a\r\s MM \m\o\n\t\h\s dd \d\a\y\s hh:mm:ss
will give: 00 years 01 months 00 days 03:47:50
The time is ok but it should shows 00 months.
You can split your result by whole part and decimal part and operate with them:
=INT(A1/86400) & " " & TEXT((A1/86400)-INT(A1/86400),"hh:mm:ss")

SUBSTITUTE formula to separate hours and minute by comma

I have formula to separate hours and minutes by comma.
=CEILING(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(P96;"s";"");" min";"");" hour ";",");0,1)
This works for 4 hours 40 mins and 1 hour 10 mins. However there might case like 20 mins. Then my formula is displaying 20 that is not correct and should be 0,2. Any suggestions how to fix this issue?
Note! Values like 4 hours 40 mins are in one cell, in this case in cell P96. Information comes straight from Google Maps xml.
=CEILING(IF(ISNUMBER(SEARCH("hour";P96));SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(P96;"s";"");" min";"");" hour ";",");"0,"&SUBSTITUTE(SUBSTITUTE(P96;"s";"");" min";""));0,1)
Conditionally add a dummy prefix that satisfies the hours substitution.
=CEILING(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(IF(ISERROR(SEARCH("hour"; P96)); "0 hours "; "")&P96;"s";"");" min";"");" hour ";",");0,1)
Type your time in cell A1. As an example, you could type "2:30", "14:30" or "2:30 PM".
Type "=HOUR(A1)" in cell A2 to produce only the hour. As an example, extracting the hour "2:30 PM" would give you "14," because 2 PM is the fourteenth hour in the day.
Type "=MINUTE(A1)" in cell A3 to extract the minutes.
Type "=SECOND(A1)" in cell A4 to extract the seconds.

Excel 2013 Date time difference

I have a column with date and time for start (IN) and end (OUT) and I want to calculate the difference in days.
Date: IN Time: IN Date: OUT Time: OUT
24/07/2018 12:15:00 26/07/2018 06:11:00
I combine them into date time IN and OUT by using:
E1=TEXT(A2,"dd/mm/yy ")&TEXT(B2,"hh:mm:ss")
F1=TEXT(C2,"dd/mm/yy ")&TEXT(D2,"hh:mm:ss")
But I am unable to find any working code for the difference in number of hours.
TEXT will convert your dates and times into text (strangely enough).
Adding the date and time will return a date/time value so you could use:
=SUM(C2:D2)-SUM(A2:B2) to return 1.74722222
(edit: if you then give the cell a custom number format of d:h:mm it will display 1:17:56 or 1 day, 17 hours, 56 minutes).
(EDIT AGAIN: Sorry, only just seen you want it in hours. Give the cell a custom number format of [hh]:mm. The square brackets tells it to count over 24 hours. This will return 41:56).
or
=DATEDIF(SUM(A2:B2),SUM(C2:D2),"d") to return 2.
or if you just want days from the dates you could just use
=C2-A2 to return 2.
Dates and times in Excel are just numbers - no need to complicate things by turning them to text.
= (F1 - E1) * 24
Rather easly :)

Excel conert seconds dd hh mm ss for larger value

I am trying to convert seconds to dd hh:mm:ss format
I am using the formula:
=A1/(24*60*60)
For 1099014 I get the result 12 17:16:54
For 2198028 I get the result 25 10:33:48
But for 3297042 I get the result 07 03:50:42
And the value for which I need the result is 7473837 and I get the result 26 12:03:57 which I suppose is not correct.
So why does the value fluctuates like this in excel and how can I exactly calculate the correct value?
Thank You
3,297,042 seconds represents 38 days 03:50:42
If you extend you format to have the whole date: yyyy MM dd hh:mm:ss
You'll see: 1900 02 07 03:50:42
That's why your format string gives you 07 03:50:42
Same thing for 7,473,837 where date is 1900 03 26 12:03:57
I might be wrong, but it seems there's no format (like [h] for hours) to tell excel to diplay number of days. Instead you could use:
=INT(A1/86400) & TEXT(A1/86400," hh:mm:ss")

Excel 2013: Convert Hours and Minutes from hh:mm:ss formatted cell in decimal number

I use Excel 2013 and have a cell with the following value:
"08.01.1900 1:45:00"
that will be displayed inside the cell as: "193:45:00" - meaning 193 hours, 45 minutes and 00 seconds (see the first image below).
Here is screen of how it looks like and the formatting of the cell
[how it looks like]
QUESTION: How I can in cell "Salary" to get decimal number, like - 193,45? Help me, please.
The cell is formatted as Time (see the image below)
So, you have Q2 = 12:30 (or 12,5 hours where 0,5 hour=30min) and R2 = 15,5 UAH/hour and since you want to calculate salary, you should multiple 12,5*15,5=193,75.
Follow next steps to achieve the desired result:
Write next formula in S2: =Q2*24*R2 (since time stored in Excel as part of a day, we need to multimply by 24 . Your value 12:30 is actually 0,520833333333333 ,you can see it if you'd format Q2 as number. Myltiplication 0,520833333333333 by 24 gives you exactly 12,5)
Format your S2 as number
the result would be 0,52*24*15,5 = 193,75 and this value is what you actually need.

Resources