Written by Allen Wyatt (last updated April 6, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365
Nicole needs to count the number of weeks worked on a contract. The contract start date (cell A1) would be November 15, which should appear in cell C1 as week one. So, when November 22 rolls around, it would be week two. When a contract completion date is entered in cell B1, then cell C1 should reflect the number of weeks between A1 and B1, rounded up as indicated. Nicole wonders if there is a function or formula that will help her determine the correct number of contract weeks.
There are any number of formulas you could use to determine your contract weeks. Any formula you use, however, should check cell B1, and if it is blank (meaning that the contract has not ended), then you could simply do your calculation based on today's date. Here is a formula that does the check and will return the proper contract weeks:
=IF(ISBLANK(B1),ROUNDUP((TODAY()-A1)/7,0),ROUNDUP((B1-A1)/7,0))
The formula could be shortened if you placed the IF function within the ROUNDUP function, in this manner:
=ROUNDUP((IF(ISBLANK(B1),TODAY(),B1)-A1)/7,0)
Of course, if you wanted to not use today's date in your calculations, but instead indicate that the contract is still open, you could go back to this variation of the first formula:
=IF(ISBLANK(B1),"Contract Open",ROUNDUP((B1-A1)/7,0))
All of these example formulas, so far, may not handle the one-week boundary properly. For instance, if the contract start is November 15 and the contract end is November 22, then the formulas return 1. However, you may want it to return 2, meaning that since the contract ended on November 22, then it should always consider that day a second week. If that is the case, then you simply need to add 1 to any of the formulas, as shown here:
=ROUNDUP((IF(ISBLANK(B1),TODAY(),B1)-A1+1)/7,0)
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13592) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2019 For Dummies today!
Different businesses have different ways to calculate elapsed time for billing purposes. Figuring out a formula that ...
Discover MoreGiven a particular week number for a year, you may want to figure out the date of the last day in that week. There is no ...
Discover MoreWant to find out how many of a particular weekday occurs within a given month? Here's how you can find the desired ...
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