#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Date formula

I want to add 12 months to a start date (inclusive of the start date) and
return the end date.
Start date will only be the first or last day of the month.
Calculated end date must only return the first or last day of the month.

Eg:

Start 06/30/2009
Add 12 months
Result should = 05/31/2010

Eg:

Start 06/01/2009
Add 12 months
Result should = 05/01/2009

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Date formula

Why does adding 12 months (1 year) to the beginning or end of June take you
to the month of May? If that is correct, then this formula should do what
you want...

=A1-DAY(A1)-(DAY(A1)=1)*((DAY(A1-DAY(A1))-1))

If you will copy this formula down for cells in Column A that are blank,
then use this variation to suppress the zero-date that would be returned for
blank cells...

=IF(A3="","",A3-DAY(A3)-(DAY(A3)=1)*((DAY(A3-DAY(A3))-1)))

--
Rick (MVP - Excel)


"nibbana" wrote in message
...
I want to add 12 months to a start date (inclusive of the start date) and
return the end date.
Start date will only be the first or last day of the month.
Calculated end date must only return the first or last day of the month.

Eg:

Start 06/30/2009
Add 12 months
Result should = 05/31/2010

Eg:

Start 06/01/2009
Add 12 months
Result should = 05/01/2009

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Date formula

That's right Rick. I want 12 (or other variable number) billing periods that
include the start date as one of them. You're formula result goes back 1 year
instead of forward. Can you post through an amendment? Here's my actual test:

A1: 30-Jun-06
A2: 12 (or any other variable periods)
A3: 31-May-07 (your formula goes here)

Thanks!
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Date formula

Oh, you want a variable time period (you didn't say that initially)... then
the approach I tried to use in my previous response cannot be patched to
handle that. Try this instead. First, make sure you have the Analysis
ToolPak Add-In selected (Tools/Add-Ins from the menu bar) and then put this
formula in A3...

=IF(A1="","",EOMONTH(A1,A2-1-(DAY(A1)=1))+(DAY(A1)=1))

--
Rick (MVP - Excel)


"nibbana" wrote in message
...
That's right Rick. I want 12 (or other variable number) billing periods
that
include the start date as one of them. You're formula result goes back 1
year
instead of forward. Can you post through an amendment? Here's my actual
test:

A1: 30-Jun-06
A2: 12 (or any other variable periods)
A3: 31-May-07 (your formula goes here)

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Date formula

Mate, you're a legend. Well done that works a treat.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM


All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"