192:00 vs. 8:00

kstvns

New Member
Joined
Feb 27, 2011
Messages
20
MS Excel 2003

I am creating a timesheet that is based on 8-hour days. The first column is labeled "Total Hours" which represents the total hours someone works. My spreadsheet has VBA code that convert numbers to time notation.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I also have a formula in each row (=IF(L8=0,SUM(C8:D8),(IF(L8=0,0,IF(SUM(C8:J8,M8)=0,8,L8+C8+D8-SUM(E8:J8)+M8))))).
<o:p></o:p>

If there are no entries in range C8:J8,M8, the result should be 8:00 vs. 192:00. If I divide the aforementioned formula by 24, the result is a blank cell vs. 8:00. However, an entry of: 30 in cell F8, for example, displays the proper result (7:30 total hours).

<o:p></o:p>
What do I need to do so that the total hours for the day show 8:00? The format is [h]: mm.
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Never mind. I believed I solved my problem as shown below:

=IF(L9=0,SUM(C9:D9)/24,(IF(L9=0,0,IF(SUM(C9:J9,M9)=0,8/24,L9+C9+D9-SUM(E9:J9)+M9))))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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