ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I convert hours to days? (https://www.excelbanter.com/excel-discussion-misc-queries/217361-how-do-i-convert-hours-days.html)

WBJ

How do I convert hours to days?
 
I am entering start-times and end-times (cols. A & B) and calculating the
duration (col B - col A) in C. I want to format the sum of all durations --
28:30, for instance (28 hours, 30 minutes) for an 8-hour day as 3 days, 4
hours, 30 minutes.

Any ideas?

Steven

How do I convert hours to days?
 
Assuming the sum of all durations in cell A1
To return the value of days =DAY(A1*3)
To return number of remaining hours =(+A1*3-DAY(A1*3))*8
To return minutes = MINUTE(A1)

If you wish you can display all 3 formula together in one cell by
joining them with
=DAY(A1*3)&" days "&(A1*3-DAY(A1*3))*8&" hours "&MINUTE(A1)&" minutes"
Let me know if this helps

David Biddulph[_2_]

How do I convert hours to days?
 
Have you looked at that with a value of more than 31/3 days in A1?
If you want to go down that route, rather than DAY(A1*3) try MOD(A1*3,1)
Rather than =(+A1*3-DAY(A1*3))*8 you may want =MOD(A1*3,1)*8, and you may
want INT around it if you want whole number of hours?
--
David Biddulph

"Steven" wrote in message
...
Assuming the sum of all durations in cell A1
To return the value of days =DAY(A1*3)
To return number of remaining hours =(+A1*3-DAY(A1*3))*8
To return minutes = MINUTE(A1)

If you wish you can display all 3 formula together in one cell by
joining them with
=DAY(A1*3)&" days "&(A1*3-DAY(A1*3))*8&" hours "&MINUTE(A1)&" minutes"
Let me know if this helps




Steven

How do I convert hours to days?
 
Thanks for tweeking the HOURS formula - so much smoother than mine.
I see the problem with the DAY formula if the value 31 days but I
don't understand the MOD formula will yield the correct answer.


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com