how do I round to nearest quarter hour

Firstime

New Member
Joined
Sep 23, 2003
Messages
1
I need to round a time to the nearest quarter hour and have it show in quarters. My formula figures out the hours worked. If the total is 8.36, then it needs to show 8.75. It needs to round up or down to nearest quater hour. How can I do this??
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello,

If the answer is 8.36 should this be rounded to 8.5 not 8.75?
Can you elaborate?
 
Upvote 0
Firsttime:

This broke my brain for a little bit, hope it works for you.
Enter this where the timevalue (Format hh:mm) you want to round up is in ColA (A3 in this case)

=(VALUE(A3/0.0104166666666667)+(1-(VALUE(A3/0.0104166666666667)-ROUNDDOWN(VALUE(A3/0.0104166666666667),0))))*0.0104166666666667

This will round up every value that exceed the 15minute mark to the next 15 mins.


regards
Weasel
 
Upvote 0
Firstime said:
I need to round a time to the nearest quarter hour and have it show in quarters. My formula figures out the hours worked. If the total is 8.36, then it needs to show 8.75. It needs to round up or down to nearest quater hour. How can I do this??

I believe onlyadrafter has a point! Shouldn't 8.36 be rounded to 8.5? That's the results if you use...

=CEILING(8.36,0.25)
 
Upvote 0
Firstime said:
I need to round a time to the nearest quarter hour and have it show in quarters. My formula figures out the hours worked. If the total is 8.36, then it needs to show 8.75. It needs to round up or down to nearest quater hour. How can I do this??

I understand the 8.36 is hours and minutes. If that is correct try this

A1 B1 C1
8.36 0.75 8.75

A1 8 Hours
A1 0.36 Minutes
B1 Minute part of A1 =ROUND(A1-INT(A1),2)*
*Must round to avoid 15th place problem with 30 minutes

C1 Converts minute portion of A1 to quarter Hours and adds whole hours

=INT(A1)+IF(B1=0,0,IF(B1<=0.15,0.25,IF(B1<=0.3,0.5,IF(B1<=0.45,0.75,1))))
 
Upvote 0
gaynard_nelson said:
I understand the 8.36 is hours and minutes...

If 8.36 was in the form of h.mm wouldn't the nearest quarter hour be 8.45 rather than 8.75?
 
Upvote 0
I think we're a bit confused over whether the OP wants a return in h:mm or decimal form; reading his question and expected result it looks like the 8:36 is h:mm which would round up to 8:45 but is 8.75 decimal.
 
Upvote 0
Mark W. said:
gaynard_nelson said:
I understand the 8.36 is hours and minutes...

If 8.36 was in the form of h.mm wouldn't the nearest quarter hour be 8.45 rather than 8.75?

I think what he is saying (I could be wrong) is 8.36 is 8 hours and 36 minutes. It looks to me like he is trying to convert that to hours and fractions of an hours ( for payroll purposes) in quarter hours increments so 8 hours and 36 minutes would round up to 8 and 3/4 of an hour (0.75)
 
Upvote 0
Hi Nelson,

I agreed with your idea, the OP is saying 8.36 in [h].mm and to convert to hours and quarter of an hour, so he wanted in 8.75

The roundup fomula :
=INT(A1)+CEILING(((A1-INT(A1))*100),15)/60

The rounddown fomula :
=INT(A1)+FLOOR(((A1-INT(A1))*100),15)/60

Regards
 
Upvote 0
Dear All,

Yes, it is a little confusing as to what the Op wants.

Here was my take.

1) totally missed the round down part - just looked at the numbers and assumed that if you go past the 1/4 interval it gets rounded up (as should be the case in any payroll situation)

2) final answer should be in hours as a fraction

The solution I provided originally will give a finish time that is ROUNDED UP to the nearest 15 minutes. The OP can then use that timevlaue and subtract the start time to give an hours worked result
The formula:
=TEXT(HOUR(A4) & "."& (100/(60/MINUTE(A4))),"00.00")

Will convert the hours worked into a decimal number.

Regards
Weasel
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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