Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Rounding Time.
Written by Allen Wyatt (last updated June 1, 2019)
This tip applies to Excel 97, 2000, 2002, and 2003
There may be instances when you need to round a time value. For instance, you may need to round some time to the nearest quarter-hour. One way to do this is to use the MROUND worksheet function, which is part of the Analysis ToolPak provided with Excel.
For example, let's assume the unrounded time was in cell B7. You could then use the following formula to perform the rounding:
=MROUND(B7, TIME(0,15,0))
This formula relies, as well, on the use of the TIME worksheet function, which returns a time value (in this case, for 15 minutes).
If you don't want to use the MROUND function (perhaps you don't want to use the Analysis ToolPak), there is another way you can round to the nearest 15 minutes. The clue is to remember that 15 minutes is 1/96th of a day. So, to round to the nearest 15 minutes, take the time value, multiply it by 96, round it, and then divide it by 96.
For example, if the time value you wish to round is in cell E5, the following formula does the rounding very nicely:
=ROUND(E5*96,0)/96
Notice that this formula uses the ROUND worksheet function, which is intrinsic to Excel and doesn't require an add-in.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2186) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Rounding Time.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
If you have a bunch of times entered into cells without the colon between the hours and minutes, chances are good that ...
Discover MoreWhen entering times in a worksheet, you may have a need to round whatever you enter to the nearest 15-minute increment. ...
Discover MoreExcel allows you to store times in your worksheets. If you have your times stored in one column and an AM/PM indicator in ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments