+ Reply to Thread
Results 1 to 4 of 4

Excel formula to increment the month by 2?

  1. #1
    thirumalairajan
    Guest

    Excel formula to increment the month by 2?

    Dear friends,

    In an excel worksheet, in a cell I am having a day, say for example
    03-May-2005 or 03-05-2005, In another cell
    I have to increment only the month by 2 i.e from 03-May-2005 to
    03-July-2005 using a formula.

    What formula should I use?

    thanks,
    Thirumalairajan.



  2. #2
    Roger Govier
    Guest

    Re: Excel formula to increment the month by 2?

    Hi

    =DATE(YEAR(A1),MONTH(A1)+2,DAY(A1)) gives the correct result, most of
    the time.

    It is incorrect if you had 29, 30 or 31 December in A1, as it would give
    dates in March rather than February for all three dates when the result
    is a non-leap year, and for the latter 2 when the result is a leap year
    The following formula, posted by the late Frank Kabel, corrects this
    issue
    =DATE(YEAR(A1),MONTH(A1)+2,MIN(DAY(A1),DAY(DATE(YEAR(A1),MONTH(A1)+2+1,0))))

    If you have the Analysis Toolpak loaded, Tools>Addins>Analysis Toolpak,
    then you could use the function
    =EDATE(A1,2)

    --
    Regards

    Roger Govier


    "thirumalairajan" <[email protected]> wrote in message
    news:Oqk1%[email protected]...
    > Dear friends,
    >
    > In an excel worksheet, in a cell I am having a day, say for example
    > 03-May-2005 or 03-05-2005, In another cell
    > I have to increment only the month by 2 i.e from 03-May-2005 to
    > 03-July-2005 using a formula.
    >
    > What formula should I use?
    >
    > thanks,
    > Thirumalairajan.
    >




  3. #3
    Bob Phillips
    Guest

    Re: Excel formula to increment the month by 2?

    Another way

    =MIN(DATE(YEAR(A1),MONTH(A1)+{2,3},DAY(A1)*{1,0}))

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    just Enter.

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "Roger Govier" <[email protected]> wrote in message
    news:#[email protected]...
    > Hi
    >
    > =DATE(YEAR(A1),MONTH(A1)+2,DAY(A1)) gives the correct result, most of
    > the time.
    >
    > It is incorrect if you had 29, 30 or 31 December in A1, as it would give
    > dates in March rather than February for all three dates when the result
    > is a non-leap year, and for the latter 2 when the result is a leap year
    > The following formula, posted by the late Frank Kabel, corrects this
    > issue
    >

    =DATE(YEAR(A1),MONTH(A1)+2,MIN(DAY(A1),DAY(DATE(YEAR(A1),MONTH(A1)+2+1,0))))
    >
    > If you have the Analysis Toolpak loaded, Tools>Addins>Analysis Toolpak,
    > then you could use the function
    > =EDATE(A1,2)
    >
    > --
    > Regards
    >
    > Roger Govier
    >
    >
    > "thirumalairajan" <[email protected]> wrote in message
    > news:Oqk1%[email protected]...
    > > Dear friends,
    > >
    > > In an excel worksheet, in a cell I am having a day, say for example
    > > 03-May-2005 or 03-05-2005, In another cell
    > > I have to increment only the month by 2 i.e from 03-May-2005 to
    > > 03-July-2005 using a formula.
    > >
    > > What formula should I use?
    > >
    > > thanks,
    > > Thirumalairajan.
    > >

    >
    >




  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by Bob Phillips
    Another way

    =MIN(DATE(YEAR(A1),MONTH(A1)+{2,3},DAY(A1)*{1,0}))

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    just Enter.
    Bob, my understanding is that this formula only requires enter, certainly works OK for me that way

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1