Written by Allen Wyatt (last updated December 16, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003
Roger is keeping track of invoices in an Excel worksheet. All of the invoices need to be submitted with a due date of the 28th of the month, and Roger wondered if there was a way to force a date to always "jump forward" to the next instance of the 28th.
The cleanest way to force dates forward is to create a formula that will examine a date in a cell, and then force that date to the next desired date, such as the 28th. The following formula is a good one to start with:
=IF(DAY(A1)>28,DATE(YEAR(A1),MONTH(A1)+1,28),DATE(YEAR(A1),MONTH(A1),28))
This formula examines the date in cell A1. If the DAY value of the date is greater than 28, then the formula constructs and returns a date that is equal to the 28th of the next month. If it is less than or equal to 28, then the 28th of the current month is returned.
There is an even shorter way to render an acceptable formula, however—one that entirely gets rid of the IF function:
=DATE(YEAR(A1),MONTH(A1)+(DAY(A1)>28),28)
This uses the current year as the year, and the day is always 28. The month uses a Boolean calculation. If the day is greater than 28 then (Day(A1)>28) will be TRUE and will calculate as a 1, thereby adding 1 to the current month. If it is less than or equal to 28 it will be FALSE and calculate as a 0, just calculating the current month.
If you don't want to be "strict" giving some people only a day (4/27/2012 will give a due date of 4/28/2012), you could plan on giving them at least a week with the formula:
=DATE(YEAR(A1),MONTH(A1)+(DAY(A1)>21),28)
This would give the 28th of the current month for the 1st thru 21st, but for later dates it will jump to the 28th of the following month.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2410) 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: Forcing Dates Forward.
Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!
Given a starting date and an ending date, you may want to generate the names of all the months between those two dates. ...
Discover MoreSome industries (such as the military) have special formatting that they use to represent dates. Here is one such format ...
Discover MoreSometimes the format in which you receive data is not the same format that would be optimal for Excel. For instance, you ...
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 © 2025 Sharon Parq Associates, Inc.
Comments