+ Reply to Thread
Results 1 to 6 of 6

Increase months by number from next column

  1. #1
    Registered User
    Join Date
    03-08-2006
    Posts
    7

    Increase months by number from next column

    Hello,

    Hope someone can help on this please.

    I have 2 columns,
    Column A contains numbers
    Column B contains dates in this format: 22-May-2006

    In Columns C it should add up the number from column A to the months in column B.

    e.g1. column A1 = 3 column B1 = 22-May-2006, in column C1 it should show 22-Aug-2006.

    e.g2. column A1 = 10 column B1 = 20-June-2006, in column C1 it should show 20-April-2007.

    Many thanks in advance.

  2. #2
    Guest

    Re: Increase months by number from next column

    Hi

    Try something like this:
    =DATE(YEAR(B1),MONTH(B1)+A1,DAY(B1))

    Andy.

    "harishnehru" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hello,
    >
    > Hope someone can help on this please.
    >
    > I have 2 columns,
    > Column A contains numbers
    > Column B contains dates in this format: 22-May-2006
    >
    > In Columns C it should add up the number from column A to the months in
    > column B.
    >
    > e.g1. column A1 = 3 column B1 = 22-May-2006, in column C1 it should
    > show 22-Aug-2006.
    >
    > e.g2. column A1 = 10 column B1 = 20-June-2006, in column C1 it should
    > show 20-April-2007.
    >
    > Many thanks in advance.
    >
    >
    > --
    > harishnehru
    > ------------------------------------------------------------------------
    > harishnehru's Profile:
    > http://www.excelforum.com/member.php...o&userid=32262
    > View this thread: http://www.excelforum.com/showthread...hreadid=544737
    >




  3. #3
    Dave Peterson
    Guest

    Re: Increase months by number from next column

    =date(year(b1),month(b1)+a1,day(b1))

    Note that you may have a problem with dates near the end of the month (30th and
    31st).

    harishnehru wrote:
    >
    > Hello,
    >
    > Hope someone can help on this please.
    >
    > I have 2 columns,
    > Column A contains numbers
    > Column B contains dates in this format: 22-May-2006
    >
    > In Columns C it should add up the number from column A to the months in
    > column B.
    >
    > e.g1. column A1 = 3 column B1 = 22-May-2006, in column C1 it should
    > show 22-Aug-2006.
    >
    > e.g2. column A1 = 10 column B1 = 20-June-2006, in column C1 it should
    > show 20-April-2007.
    >
    > Many thanks in advance.
    >
    > --
    > harishnehru
    > ------------------------------------------------------------------------
    > harishnehru's Profile: http://www.excelforum.com/member.php...o&userid=32262
    > View this thread: http://www.excelforum.com/showthread...hreadid=544737


    --

    Dave Peterson

  4. #4
    Michael Bednarek
    Guest

    Re: Increase months by number from next column

    On Tue, 23 May 2006 10:00:04 -0500, harishnehru wrote in
    microsoft.public.excel:

    >Hope someone can help on this please.
    >
    >I have 2 columns,
    >Column A contains numbers
    >Column B contains dates in this format: 22-May-2006
    >
    >In Columns C it should add up the number from column A to the months in
    >column B.
    >
    >e.g1. column A1 = 3 column B1 = 22-May-2006, in column C1 it should
    >show 22-Aug-2006.
    >
    >e.g2. column A1 = 10 column B1 = 20-June-2006, in column C1 it should
    >show 20-April-2007.


    I think that's what the function EDATE(start_date,months) from the
    Analysis Toolpack is there for.

    C1: =Edate(B1,A1)

    Days near the end of a month in column B which might not exist in the
    computed date will result in the last day of that computed month; the
    formula
    =DATE(YEAR(B1),MONTH(B1)+A1,DAY(B1))
    is flawed as it will compute the appropriate day in the following month
    in those cases.

    --
    Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    EDATE is simpler, of course, but if you can't or don't want to use Analysis ToolPak this will replicate EDATE

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

  6. #6
    Registered User
    Join Date
    03-08-2006
    Posts
    7

    Thumbs up

    Many thanks for all of you. The formula from Andy and Dave Peterson are similiar and works fine. But as Michael Bednarek mentioned the month will carry over to next month for 30 days months or 28 Feb.

    The formula from daddylonglegs doesn't carry over to next month and its end at the last day of the month.

    I have used daddylonglegs formula and many thanks once again to all of you.

+ 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