+ Reply to Thread
Results 1 to 3 of 3

Subtracting Dates

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    nj
    MS-Off Ver
    Excel 2003
    Posts
    5

    Subtracting Dates

    Hello,

    I need help subtracting dates in excel. The worksheet I am working with needs all dates to be the last day of the month (for example, 7/31/10).

    I want to 7/31/10 at the top of the worksheet, and then have excel automatically deduct one month from that date continuously for 24 months. I have tried several formulas, but they always get messed up because of the differing amounts of days in each month. I have figured out how to do this if I use the first day of the month instead of the last, but for this specific spreadsheet, I need the end of the month.

    The formula I have been toying around with is:
    =DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))

    But, this is what I get:
    7/31/10
    7/1/10
    6/1/10
    5/1/10
    4/1/10
    3/1/10
    2/1/10
    1/1/10... and so on.

    What I want is:
    7/31/10
    6/30/10
    5/31/10
    4/30/10
    3/31/10
    2/28/10
    1/31/10
    12/31/10 ... and so on

    Thanks so much in advance!
    Last edited by arebryn; 06-23-2010 at 01:04 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Subtracting Dates in Excel 2003

    Try:

    =DATE(YEAR(A1),MONTH(A1),0)

    copied down.

    or if you have the Analysis Toolpak Functions available.

    =EOMONTH(A1,-1)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-22-2010
    Location
    nj
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Subtracting Dates in Excel 2003

    They both worked, thank 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