LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Dates - Need to display date one month prior to user-entered date

I'm looking for a formula that displays the billing-month start date based on
a user-entered end date. The system I will be using this calculation for
considers billing month periods as ending one month less one day after the
billing month start date. For example, if my billing month starts on April
1, it ends on April 30. If starts on May 1, it ends May 31. If starts on
April 15, it ends on May 14. If starts on February 28, it ends on March 27
(non-leap year). If starts on February 29 (leap year), it ends on March 28.

For example, if a user enters an end date of 31-JAN-08, the billing month
start date that the formula will calculate should show 01-JAN-08. If the
user enters an end date of 15-JAN-08, the billing month start date the
formula will calculate should show 16-DEC-07.

I thought a very easy way to do this would be using the DATE function:
=DATE(YEAR(H5),MONTH(H5)-1,DAY(H5)), where H5 is the cell the user enters the
end date into.

Below are the results I achieved using this formula, which are all over the
place. I have included here only months that have 31 days in them to show
how this formula yields different results even on months with the same number
of days. The first column lists the user-entered end date I entered into
Excel, and the second columns shows the results given by the DATE formula I
listed above.

User-entered end date Billing-month start date
Jan-31-2008 Dec-31-2007
Mar-31-2008 Mar-02-2008
May-31-2008 May-01-2008
Jul-31-2008 Jul-01-2008
Aug-31-2008 Jul-31-2008
Oct-31-2008 Oct-01-2008
Dec-31-2008 Dec-01-2008

Only the months of May, July, October, and December yielded the correct
billing-month start date (which starts on the first of the month in this
example).

The results using this formula were equally chaotic for months with only 30
days in them.

Once last thing to note: In my sample dates above I used the last day of
the month as the user entered end date in order to give a consistent example.
In practice, the user-entered end date can be any day of the month, not just
the last day of the month.
 
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
date entered display Kate Excel Discussion (Misc queries) 7 April 11th 07 08:46 PM
incrementing a date that the user has entered? pano Excel Worksheet Functions 4 January 23rd 07 03:22 AM
Date arithmetic: adding 1 month to prior end of month date manxman Excel Worksheet Functions 2 July 14th 06 09:29 PM
dates, 1 month prior wfactor Excel Worksheet Functions 5 June 19th 06 08:23 AM
Display Last Saved By date & User? Annabelle Excel Discussion (Misc queries) 4 October 4th 05 08:27 PM


All times are GMT +1. The time now is 01:15 PM.

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

About Us

"It's about Microsoft Excel"