Rounding minutes

Weasel

Board Regular
Joined
Sep 13, 2005
Messages
58
I'm working on creating a time sheet in which I enter a time and it then spits out a decimal that the time corresponds to (i.e. someone worked 8:30 = 8.50). So in cell A1 I have the hours worked and in cell A2 I have the formula A2*24.

What I now need to do is figure out a way to round the minutes based on the following criteria:

If minutes are between 0-7 then round down to the hour (i.e. 7:06 = 7.0)
If minutes are between 8-22 then round to .25 of an hour (i.e. 5:12 = 5.25)
If minutes are between 23-42 then round to .50 of an hour (i.e. 9:32 = 9.50)
If minutes are between 43-52 then round to .75 of an hour (i.e. 3:49 = 3.75)
If minutes are between 52-59 then round up to the hour (i.e. 10:54 = 11.00)

Thanks in advance for any help
 
I don't think *rounding* is quite what you're doing here... a LOOKUP function seems more appropriate.
 
Upvote 0
yeah, it almost works but as the above reply points out it doesn't work perfectly. Since I'm dealing with timesheets it has to be perfect. Anyone know of a way I can fully implement this?
 
Upvote 0
If you really want to round 9:42 to 9.5 and the other times as specified then with your hours worked in A2 (in time format) try

=LOOKUP(MINUTE(A2),{0,8,23,43,52;0,0.25,0.5,0.75,1})+INT(A2*24)

format as number
 
Upvote 0

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