Rounding Time from a decimal

Kopy

New Member
Joined
Apr 4, 2013
Messages
10
Hello,

I'm not very good with excel and I've been searching forums for help and there are some very close answers but nothing close enough. I'm trying to create a timesheet that takes into account multiple in and out times and uses decimals to denote time so 5am and 5pm both show as 5.00. The total hours should then be calculated out in quarter hours. I've provided an example below, in this instance the correct Total Hours for Friday would be 11.25, I just need a function that will help me get that. Any assistance would be great.

In5.00
Out10.00
In11.00
Out5.21
In0.00
Out
0.00
In0.00
Out0.00
Total Hrs11.25

<colgroup><col><col></colgroup><tbody>
</tbody>
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
So if someone came in at 5 and left at 5.5, did they work for 0.5 hours or 12.5 hours?
 
Upvote 0
Are the number of in/out pairs fixed and in certain rows?

Assuming rows 1-8 are in/out pairs:

B9 = <b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0) 4
<b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0) 4
round(((IF(B8 < B7,B8+12,B8)-B7)+(IF(B6 < B5,B6+12,B6)-B5)+(IF(B4 < B3,B4+12,B4)-B3)+(IF(B2 < B1,B2+12,B2)-B1))*4,0)/4
it keeps cutting off my formula<b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0) 4<b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0)="" 4<="" html=""></b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0)></b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0)></b7,b8+12,b8)-b7)+(if(b6<b5,b6+12,b6)-b5)+(if(b4<b3,b4+12,b4)-b3)+(if(b2<b1,b2+12,b2)-b1))*4,0)>
 
Last edited:
Upvote 0
So if someone came in at 5 and left at 5.5, did they work for 0.5 hours or 12.5 hours?

Well if they typed 5.00 in and 5.50 out it would actually be .75 hours because the way our old spreadsheet worked it actually took the in/out times as actual time so 5.00 is 5:00am/pm. The old timesheet was using macros which is proving problematic for our Mac users, so I'm trying to make one that works for them. If they wanted to work over 5 hours 5:00a - 5:30pm they're required to take a 30 min break and the old timesheet knew that, that's a bit more complicated than I wanted to get into with this timesheet.

So in short for this 5.00 - 5.50 would be total hrs .75
 
Upvote 0
I'm confused. Is the decimal portion minutes not portion of an hour?
 
Upvote 0
I'm confused. Is the decimal portion minutes not portion of an hour?
I have that same question... for the 5.21 time, is that 21 minutes or 0.21 hours (that is, 21/100 of an hour)? And whichever it is, I presume the total is the same unit of measure.
 
Upvote 0
I figured since the total rounded to .25 to get nearest quarter hour worked that the .21 was 21/100th of an hour.
 
Upvote 0
I'm confused. Is the decimal portion minutes not portion of an hour?

Sorry I know it's a bit confusing. The decimal within the in/out does not represent quarter hours but actual time of day. The quarter time gets added at the end. So if someone writes 5.21 they actually mean 5:21 and then in the total hours it's converted to quarter hours. So 5.21 - 7.55 (5:21 - 7:55am/pm) is total hours 2.50
 
Upvote 0
I figured since the total rounded to .25 to get nearest quarter hour worked that the .21 was 21/100th of an hour.



I took a quick look this is how the Minutes Convert:
Minutes - Quarter Hours
00-07 - .00
08-22 - .25
23-37 - .50
38-52 - .75
53-60 - 1.00
 
Upvote 0

Forum statistics

Threads
1,203,321
Messages
6,054,717
Members
444,746
Latest member
Emre06

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