Convert Sum of Time to Decimals

dwgnome

Active Member
Joined
Dec 18, 2005
Messages
441
In this spreadsheet start and stop times are clocked in [h:mm] format in specific columns. The row has nine such available start/stop iterations. Each row represents a complete 24-hr day. In most cases only a few Time columns will have data. The first Time column is presumed to always be a start time of midnight (12:00). I have this relatively simple formula that calculates the total cumulative operating time in hours and minutes and converted to decimal hours. It seems to work fine, except I cannot get the case where there is no stop times during the day and the answer should be 24.00 hours. That is the entire row is blank with the exception of the first time being 0:00. Since there is no 24:00 clock time, a 0:00 is input, representing 12:00:00 AM. This is fine; however, I cannot get 24 to show up in the Daily Total column.

Can someone show me how to reveal the 24 hours value? I would like to show 24:00 (probably only as text) and 24.00 as number. Columns with FT, Mode and Reason can be ignored.

Also, I would like to invoke a rule, that if the total is between 23 hours and 50 minutes and 23 hours and 59 minutes, to round up to 24 hours showing as 24.00 hours.

If there is a more elegant solution using perhaps SUMIF or SUMPRODUCT that can look for the word START and STOP and get the times in the cell just before and add/subtract as needed – I would welcome any suggestions as well.



Excel Workbook
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAM
2Day123456789Daily Total (Hrs:Mins)Daily Total (Hrs)
3TimeModeFTReasonTimeModeFTReasonTimeModeFTReasonTimeModeFTReasonTimeModeFTReasonTimeModeFTReasonTimeModeFTReasonTimeModeFTReasonTimeModeFTReason
41**************************************
5CG**************************************
6DB0:00StartG*********************************0:000.00
7AX10:00RunG*4:05StopG*5:05StartG*5:15StopG*5:20StartG*5:25StopG07:10StartG27:50StopG413:30StartG215:3015.50
8Ax20:00RunG*5:00StopG*5:00StartG**StopG**StartG**StopG0*StartG25:01StopG45:02StartG223:5923.98
9KX0:04Run**********************************23:5623.93
Start Stop
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try formatting the time columns as Custom Format [hh]:mm
<input id="gwProxy" type="hidden"><!--Session data--><input *******="jsCall();" id="jsProxy" type="hidden">
 
Upvote 0
I tried formating to [hh]:mm in the Daily Total column and the number turned to 576:00. When I divide by 24 it gives 24:00. Conversion to decimal does not work in the next column either. This solution however, that will not work for the rows that have data. Changing the formatting results in incorrect values.

Need a solution that applies in all cases. :(

Thank you.
 
Upvote 0
Try this in AM6:

Code:
=IF(IF(AL6=24,24,HOUR((VALUE(AL6)))+ROUND(MINUTE((VALUE(AL6)))/60,4))>=23+50/60,24,IF(AL6=24,24,HOUR((VALUE(AL6)))+ROUND(MINUTE((VALUE(AL6)))/60,4)))

If you wish to round to 24 when total time is >=23:50 not just >23:50, then change the 50/60 in the formula above to 49.5/60. You have to do this because of the round function.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,935
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top