+ Reply to Thread
Results 1 to 7 of 7

Formula to display the last day of the previous month

  1. #1
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Formula to display the last day of the previous month

    I am using the following formula to show the first day of previous 6 month cycle.

    =DATE(YEAR(TODAY()),MONTH(TODAY())-6,1)

    That formula would display: 07/01/2009

    I want to have another formula show the last day of the previous month.

    Basically it would display: 12/31/2009

    I appreciate any help with this.

    thanks,
    Nick
    Last edited by avidcat; 01-22-2010 at 10:02 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to display the last day of the previous month

    A few options

    XL2007 and beyond (or with ATP activated)

    =EOMONTH(TODAY(),-1)

    Pre XL2007

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

    or better yet simply

    =TODAY()-DAY(TODAY())

  3. #3
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: Formula to display the last day of the previous month

    Hi There

    Does this help?


    Please Login or Register  to view this content.
    Cheers

    Jim

    Sorry- seen a much easier solution arrived before me!!!

  4. #4
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Formula to display the last day of the previous month

    Very cool, I am using 2007.

    I am trying to learn more excel.

    =EOMONTH(TODAY(),-1)

    EOMONTH : is for end of month
    TODAY : what does the TODAY value represent in the formula?
    -1 : for the previous month

  5. #5
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: Formula to display the last day of the previous month

    the Today() is telling it which month you want the end date of, putting -1 then tells it to look at the end of the previous month and not the current.

    Jim

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to display the last day of the previous month

    avidcat, never be afraid to use the power of F1 in XL... typing in EOMONTH, TODAY etc ...

    Or if you prefer highlight the appropriate function you're interested in within the formula bar view and press the fx button to the left.

  7. #7
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Formula to display the last day of the previous month

    Thanks, actually did that for EOMONTH, I was just trying to see how TODAY fit in.

    I appreciate all the help.

    Nick

+ 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