Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Rounding to the Nearest Quarter Hour.

Rounding to the Nearest Quarter Hour

by Allen Wyatt
(last updated April 25, 2019)

18

Lisa is trying to set up a timesheet. It needs to go by the seven-minute rule. If it is 7 minutes till the hour it rounds to, say, 8:00 am; if it is 10 till it rounds to 7:45. If it is 7 minutes after it would be 8:00, and 8 minutes after would be 8:15 am. In other words, whatever time is entered needs to be rounded to the nearest quarter hour.

The full name of the rule that Lisa mentions is the "7/8-minute rule." It's a throwback to when timecards were processed manually. Depending on the particular time clock, the rule may not have the same result as quarter-hour rounding. Consider that the 7/8-rule rounds down all the way to 7 minutes and 59.9 seconds whereas quarter-hour rounding rounds down only to 7 minutes and 29.9 seconds. It's not a huge difference, but the 7/8-minute rule in a payroll context gives employers a 30 second freebie.

If Lisa is only entering hours and minutes, then quarter-hour rounding is just fine. This can be handled in a number of different ways. For instance, you could create a lookup table that shows what the rounded time would be for each time within the hour, and then—based on the number of minutes in the original time—use VLOOKUP (or one of the other lookup functions) to determine the correct minutes.

A better way, however, is to remember that Excel stores times as a fraction of a day, so to convert any given time to minutes you simply multiply a time value by the number of minutes in a day (24 * 60 = 1440). You can then divide by the desired time interval, in this case 15. This means that you can use any of the following equivalent formulas, if the time you want to round is in cell A1:

=ROUND(A1*(24*60/15),0)/(24*60/15)
=ROUND(A1*(1440/15),0)/(1440/15)
=ROUND(A1*96,0)/96

If you prefer, you can also "reverse" the formula by using any of these equivalent formulas:

=ROUND(A1/(15/(24*60)),0)*(15/(24*60))
=ROUND(A1/(15/1440),0)*(15/1440)
=ROUND(A1/0.01041667,0)*0.01041667

If you have the Analysis ToolPak enabled on your system, you could also use the MROUND function to determine the rounded time. The following are equivalent formulas that use the MROUND function:

=MROUND(A1,15/60/24)
=MROUND(A1,0.25/24)
=MROUND(A1,0.01041667)

If you are not comfortable figuring out the number that Excel uses to represent 15 minutes (as is done in these formulas), you could combine MROUND with the TIME function, in this manner:

=MROUND(A1,TIME(0,15,0))

As mentioned, all the formulas presented so far assume that seconds are not being entered into the original value. If they are being entered and you want to use the 7/8 rule exactly (favoring the employer for that half minute), then you need to use an adapted formula, in this manner:

=ROUND((A1*1440-0.5)/15,0)*(15/1440)

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9360) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Rounding to the Nearest Quarter Hour.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Viewing Footnotes and Endnotes

Footnotes and endnotes are normally visible with the rest of your document, but such visibility is dependent on which ...

Discover More

Understanding the Hot Zone

Need to hyphenate your document? Then you need to know about the hot zone because it controls how words are hyphenated

Discover More

Converting Coded Dates into Real Dates

Sometimes the format in which you receive data is not the same format that would be optimal for Excel. For instance, you ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Parsing Non-Standard Date Formats

When you load data into Excel that was created in other programs, the formatting used for some types of data (such as ...

Discover More

Date for Next Wednesday

When working with dates, it is often helpful to be able to calculate some date in the future based on a starting date. ...

Discover More

Pulling All Fridays

It can be handy to know when specific weekdays occur within a range of dates. Figuring out this information, using ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 9?

2019-07-28 13:53:40

Willy Vanhaelen

@Monica
This little macro will do the job:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Application.EnableEvents = False
Target = Round(Target(1) * 96, 0) / 96
Application.EnableEvents = True
End Sub

Just enter the hour (hh;mm) in a cell of column A and the macro will automatically round it.

If you use another column to enter the date, adjust <>1 in the first row: <>2 for column B, <>3 for column C ...

Attention: this macro must reside in the worksheet's code page (not in a module). Right click the worksheet tab and select View Code. That's the place to be.


2019-07-24 22:22:35

Monica

Hi Allen, Thanks for the tip. It worked perfectly but, I am hoping you can tell me how to calculate both the time elapsed AND round the elapsed time to the 1/4 hour in ONE cell? I am working with very limited space so calculating the time elapsed in one cell then rounding it in a second cell is not desired. Thanks for your help!


2018-07-01 12:42:40

Peter Atherton

Edna

After further testing the following might be better

=IF(MOD(MINUTE(B3),15)<=5,ROUNDDOWN(B3*96,0)/96,ROUNDUP(B3*96,0)/96)

It handles people arriving after (:30, 9:45 and so on.


2018-07-01 09:51:00

Peter Atherton

EdnaAssuming that the Start Time is in B3 one way is to insert a column before the End Time to Adjust the Start Time using this formula:=IF(B3>TIME(HOUR(B3),5,0),ROUNDUP(B3*96,0)/96,TIME(HOUR(B3),0,0))[{fig}]HTH


2018-06-30 13:33:19

Edna

Great Article! So I am trying to figure out a '5/10 minute rule.' So if the employee works 10 minutes in the quarter hour period they will be paid for 15 minutes. Anything less than 10 minutes in that quarter hour, they will not get paid for the quarter hour.
So if they clock in at 8:06, they will not get paid from 8:00 to 8:15. But if they clock in at 8:05, they will get paid from 8:00 to 8:15.
Currently, we use the 'counting on our fingers method.' Would like to have a spreadsheet for this.
Thanks


2018-04-13 19:09:50

Peter Atherton

Don

Round to the nearest 1/2 hour, but note that 4:15 rounds up 4:30 which is surely what you want.

=MROUND (A1,TIME(0,30,0))


2018-04-12 09:38:59

MIchael Armstrong

Why not just join the 21st century and pay to the nearest hundredth of an hour?


2018-04-11 23:40:24

Don

Hi, thanks for the tip.
Is there a way I can specify then to round up and round down?
For example, if time worked is 4hr15, it is rounded down to 4 hrs, but if it is 4hr 16+, it is rounded up to 5hrs.


2017-04-07 12:25:01

Selena

2-Apr-17 4:53 AM 12:00 PM 12:30 PM 2:30 PM 9.12 0 I AM TRYING TO CREATE A FORMULA THAT WILL ROUND DOWN TO 9 HOURS WITH AUTOMATICALLY SETTING THE TIME SHEET IN THIS FORMAT. I CANT SEEM TO FIGURE THIS OUT. I HAVE WORKED SEVERAL SCENARIOS AND I JUST CANT FIGURE IT OUT.

my Cells

B6 C6 D6 E6 F6
Time In Lunch Out Lunch In End Time Total Time
4:53 AM 12:00 PM 12:30 PM 2:30 PM 9.12

I am trying to set it up to where if I am out one day my assistant can just plug in the time such as I listed above, it is set up in formula and we can do calculations much easier. I'm lost.


2016-11-03 16:28:55

Michael (Micky) Avidan

@Samantha,

Try: =FLOOR(A1,15/24/60)

--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2017)
ISRAEL


2016-11-02 16:44:59

Samantha

Hi this formula is what I am looking for however, I need the formula to calculate backwards for example
if an employee clocks in in between

8:00 and 8:15 then the clock in time should read 8:00
8:15 and 8:30 then the clock in time should read 8:15
8:30 and 8:45 then the clock in time should read 8:30
8:45 and 9:00 then the clock in time should read 8:45


2016-11-02 11:44:52

Kari

@Willy

Thanks-worked perfect.


2016-11-01 14:20:28

Willy Vanhaelen

@Kari

I overlooked the round part.

Here is the formula: =ROUND((C2-B2)*96,0)/4


2016-11-01 13:37:50

Willy Vanhaelen

@Kari

This formula will do =(C2-B2)*24

See to it that the cell isn't formatted as a date.
A number format or General will do.


2016-10-31 11:38:52

Kari

I am trying to add hours and round them to the nearest .25. If an employee works from 12:30 pm- 5:00 pm, I need the answer to be 4.5 hours. If I use =sum(c2-b2), I get 4:30, but I am wondering how to get 4.5 hours instead.


2016-05-16 12:03:17

MICHELLE HANSEN

I am trying to enter a rounding formula for a time sheet. With a start time of 07:53, lunch 12:00 - 13:00, time out @ 17:01. I need it to round to the nearest quarter of an hour but the formula I am using is still giving the employee and extra 0.25. The formula I have is =ROUND((D8-B8+H8-F8)*96,0)/4. What formula can I use so that the total hours is 8 and not 8.25?

Thank you


2015-07-31 08:34:59

Dan

Genius! Thank you! Is exactly what I needed


2014-02-01 10:57:02

Juan

How does the first formula: =ROUND(A1*(24*60/15),0)/(24*60/15)
reflect all the conditions expressed in the first paragraph?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.