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")
Related
I am attempting to determine the number of months and days between two dates to determine an group of individuals length of service, so that I can ascertain if they are within 2 ranges 0-6 mths and 6-23mths, I have the following but I'm missing something, as it can't seem to handle 10 months or over, its returning 0-6 mths for those. I will also need to add a third range (0-6, 6-12 & 12-23) for a future project but am having difficulties with this one also?
=IF(DATEDIF(F155,G155,"ym")&" months " &DATEDIF(F155,G155,"md")&" days">="6 months 0 days", "6 - 23 Months","0 - 6 Months")
The problem is that you are comparing 2 strings that do not have the same format:
For example for dates 1/1/2019 with 11/1/2019 you are comparing "10 months 0 days" vs "6 months 0 days" (a 2 digits number vs a 1 digit number in the begining strings). You have to make them the same format to be able to compare:
=IF(DATEDIF(F155,G155,"ym")&" months " &RIGHT("0"&DATEDIF(F155,G155,"md"),2)&" days">="06 months 00 days", "6 - 23 Months","0 - 6 Months")
This way you would be comparing "10 months 00 days" vs "06 months 00 days" and since now they have the same format it will work.
It might be simpler to use VLOOKUP.
And, if you expect to get a range of 12-23 months, why are you using the "ym" argument for DATEDIF? That can never return a value more than 12.
I suggest something like:
=VLOOKUP(DATEDIF(F155,G155,"m"),{0,"0 to 6 months";6,"6 to 12 months";12,"12 to 23 months";24,"undefined"},2)
Also, suggest you read about the different arguments for DATEDIF; and you should probably read HELP for VLOOKUP also.
If you need to extend the table more, consider putting it into an Excel table instead of an array constant.
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
I have a formula that works out the diffrence between 2 times:
=IFERROR(IFNA(TEXT(H2-Q2,"dd - hh:mm"),"noData"),B2)
What I need to do now in the next cell (S2) is:
Anything that is =< 00 - 00:40 Mark as Late
Anything that is > 00 - 00:40 Mark as Early
Anything that is ="noData" Mark as noData
I have tried a few things but as it is not a number it is not working.
I have 3 columns formatted as text: hours, minutes, seconds
I need to consolidate them in a time format
e.g.
1 34 56 -> I need a cell with 1:34:56
23 02 11 -> 23:02:11
Is this possible without macro/code?
I had issues with escaping the colon
Did you look up the "TIME" built in function? See the screen shot ...
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")