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: Automatically Advancing by a Month.

Automatically Advancing by a Month

by Allen Wyatt
(last updated March 13, 2015)

10

Jim has a need to advance the date in a particular cell by one month at midnight on the 14/15 of each month (00:00:00 on the 15th), and he wondered how it could be done.

As with many problems in Excel, the answer depends on the nature of the data involved and exactly what you want to do. If the date in the cell is today's date, and you simply want to have the cell display the current month up through the 14th, and then next month after that, then you can use a formula such as the following:

=CHOOSE(IF(DAY(NOW())>14,MONTH(NOW())+1,MONTH(NOW())),
"January","February","March","April","May","June",
"July","August","September","October","November",
"December","January")

This formula returns the name of a month, not a date. If you prefer to have a date returned, you can use this formula:

=IF(DAY(NOW())>14,DATEVALUE(IF(MONTH(NOW())=12,1,
MONTH(NOW())+1) & "/" & DAY(NOW()) & "/" & IF(MONTH(
NOW())=12,YEAR(NOW())+1,YEAR(NOW()))),NOW())

Both of these formulas account for the "end of year wrap-around" when you advance from December to January. A shorter version of this last formula can be created if you use the DATE function instead of the DATEVALUE function:

=DATE(YEAR(NOW()),MONTH(NOW())+((DAY(NOW())>14)*1),1)

This formula, unlike the DATEVALUE example, always returns a date that is the first day of any given month.

If you really want to advance the value of a particular date in a cell, then you must use a macro to do the task. Further, you must make sure that the macro only runs once a month, at a particular time on a particular day. For instance, if you wanted the macro to run at 00:00:00 on the 15th of each month, you would need to set up the macro so that it checked the date and time, and then ran at that particular date and time. You would also need to make sure that the workbook containing the macro was open over that date and time.

The following macro will fetch the date from a cell and increase it by a month. The macro assumes that you have a named range, DateCell, which refers to the cell to be updated.

Sub IncreaseMonth()
    Dim dDate As Date
    dDate = Range("DateCell").Value
    Range("DateCell").Value = _
      DateSerial(Year(dDate), _
      Month(dDate) + 1, Day(dDate))
End Sub

To make sure that the macro runs at the appropriate time, you would need another macro. The following macro is designed to be run whenever the workbook is opened:

Private Sub Workbook_Open()
If Day(Now) = 14 Then
    Application.OnTime ("23:59:59"), "IncreaseMonth"
End If
End Sub

Notice that this particular macro sets the OnTime method so that it runs the IncreaseMonth macro at 23:59:59 on the 14th. This date and time was chosen because it is easier to catch than is 00:00:00 on the 15th.

Remember that the IncreaseMonth macro will only run if you open the workbook on the 14th, and then leave the workbook open until the 15th.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2180) 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: Automatically Advancing by a Month.

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

Printing Summary Information

Word automatically maintains a number of properties for each document you create. As part of those properties you can include ...

Discover More

Losing All Formatting in a Document

Have you ever made a formatting change to a couple of characters or to a paragraph, only to see those changes affect text ...

Discover More

Style Names Can Affect Style Definitions

Most people think that you can name styles almost anything you want. You can, but there may be some unintended consequences ...

Discover More

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 2013 For Dummies today!

More ExcelTips (menu)

Specifying Different Weekends with NETWORKDAYS

The NETWORKDAYS worksheet function can be used to easily determine the number of work days (Monday through Friday) within a ...

Discover More

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 dates) ...

Discover More

Using the EOMONTH Function

If you need to determine the date of the last day in a month, it's hard to beat the flexibility of the EOMONTH function. This ...

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 8Mpixels. 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 eight less than 9?

2017-04-26 04:09:30

Michael (Micky) Avidan

@Chelsea,

Check if the proposed formula answers your question.

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

Figure 1. 


2017-04-25 21:15:09

Chelsea

I too would like to know how to automatically advance the date a year.

I have a spreadsheet with contract expiration dates that automatically renew each year. I'd love to know a formula to have the date automatically jump one year (or 2, depending on the contract) based on the start date. So if a contract start date was 24 May 2015, I'd like the expiration to automatically jump to 23 May 2018 once 24 May 2017 hits. Is this possible? Thanks!


2017-04-24 13:18:04

Elisha

I have a question-- I am working on a sheet where I am using sheet one as YTD (overall total and row for monthly) then on sheet 2 doing a monthly break down. Is there are formula that will pull to YTD the monthly number advancing each month so that way the formula doesn't have to be redone each time? EX,- when April info is added into monthly sheet it is pulled into ytd without have to change the cell on the main sheet?


2017-03-03 11:09:16

Patrick Brethen

How would I do this if want to advance a date once a year?

I track age changes of employees based on an anniversary. So for example, I need to list employee ages as of 9/1 each year. How do I automate this so when I open the workbook it auto-populates the age as of the most recent 9/1 anniversary?

thanks!


2016-09-17 13:52:01

Ohisio John

Dear Allen Wyatt,

I used this function between Months. e.g from September to October. The function works well. This is how I did it but when the system, I meant when entering into a new Month, it showed me From October To October (the same Month). It does not show me From October To November. What could the error ?.

for September is below
=CHOOSE(IF(DAY(NOW())>14,MONTH(NOW())+0,MONTH(NOW())),
"January","February","March","April","May","June",
"July","August","September","October","November",
"December","January")

for October is below
=CHOOSE(IF(DAY(NOW())>14,MONTH(NOW())+1,MONTH(NOW())),
"January","February","March","April","May","June",
"July","August","September","October","November",
"December","January")

Please help.


2015-11-05 00:01:22

Vasile

hello to get the current month I think the bellow formula is more useful and shorter:

=PROPER(TEXT(NOW();"mmmm"))


2014-08-04 14:10:27

Barry

@Chetan

Using the EDATE function incrementing 31-Oct-2013 by 1 month gives 30-Nov-2013, incrementing 31-Oct-2013 by 4 months would give 28-Feb-2104 (and incrementing 31-Oct-2011 by 4 months would give 29-Feb-2012 as 2012 is a leap year).

@SM 10
I don't know idf you've figured this out by now - it's a year since you posted your request. But for anyone else the following function does what you want:

=TEXT(EDATE(A1-21,1),"mmmm") - assuming the date is in cell A1


2014-08-03 09:30:01

Michael (Micky) Avidan

To my opinion (if I correctly understood the task) the best and shortest way will be:
=IF(DAY(NOW())>14,EDATE(NOW(),1),NOW())
*** In the old versions (2000-2007) the EDATE function is part of the Analysis Toolpak Add-In, which comes with Excel, but needs to be activated.
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL


2014-08-02 18:33:14

chetan

If date is is 31.10.2013 then how you will increase by one month. If you do this it will increase to 1.12.2013


2013-04-26 10:31:10

SM10

I want to do a similar type of formula as above however I want to be able to display a specific month depending on the date.

for example
If the date entered between 22/01/2013 and 21/02/2013 I want to display February.
If the date entered between 22/02/2013 and 21/02/2013 I want to display March.
If the date entered between 22/03/2013 and 21/04/2013 I want to display April.
And so on and so on....

How can I do this using a simple formula?


This Site

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.

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.