Increase months by number from next column

H

harishnehru

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.
 
D

Dave Peterson

=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).
 
M

Michael Bednarek

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.
 
D

daddylonglegs

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}))
 
H

harishnehru

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top