Written by Allen Wyatt (last updated August 9, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Piers has a report which runs and once it is complete, he logs the start time and duration, in seconds. If A1 is the start time and B1 is the number of seconds, Piers uses the following formula to determine the ending time:
=A1+TIME(0,0,B1)
The formula works fine, unless report execution took over 32,767 seconds, which often happens. Piers wonders what formula he can use to get past this apparent Excel limitation.
First, it is important to understand that what you have discovered is, indeed, a limitation of Excel. Or, more precisely, a limitation of the TIME function. The three parameters you use in the function (representing hours, minutes, and seconds) must be integer values. That is "programming speak" for the fact that each value must be in the range of 0 to 32767. Outside that range, and you get an error.
One solution is to simply make sure that you don't use a value that is outside of this range. I like this recasting of the formula, still using the TIME function:
=A1+TIME(INT(B1/3600),0,MOD(B1,3600))
Whereas the limit in your original formula meant that you could not have a report run for much more than 9 hours (32767 seconds), this revised formula will handle durations of nearly 4 years. (If you have reports that are taking more than 4 years to run, something is probably wrong!)
Of course, you could bypass using the TIME function altogether and simply come up with your own formula to add the seconds to the value in A1. This is easier than it may seem; all you need to do is remember that time values are stored, within Excel, as fractions of a day. Since there are 86,400 seconds in each day (60 seconds * 60 minutes * 24 hours), you could use this formula:
=A1+B1/86400
Just make sure that the cell containing the formula is formatted to display times, and you'll have no problem. (Just format the cell the same way that cell A1 is formatted; you can use the Format Painter to do this.)
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9421) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Dealing with Large Numbers of Seconds.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
Need to check the current time in a formula you are putting together? It can sometimes be tricky to remember what Excel ...
Discover MoreWhen you use a formula to come up with a result that you want displayed as a time, it can be tricky figuring out how to ...
Discover MoreEntering the current time into a cell is easy, as Excel provides a built-in shortcut to accomplish the task. Here's a ...
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 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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments