+ Reply to Thread
Results 1 to 3 of 3

current month follow-up question

  1. #1
    Registered User
    Join Date
    12-08-2008
    Location
    montreal
    Posts
    69

    current month follow-up question

    =Date(year(today()),month(today()),A1)

    works great,

    However I need the formula to subtract 1 month if the value returned would be greater than today's date.
    Last edited by vasto; 09-28-2009 at 03:16 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: current month follow-up question

    How about?

    =DATE(YEAR(TODAY()),MONTH(TODAY())-IF(DATE(YEAR(TODAY()),MONTH(TODAY()),A1)>TODAY(),1,0),A1)
    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
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: current month follow-up question

    Please Login or Register  to view this content.
    However, if that day of the month doesn't exist, it will carry into the next month.
    For example, if today is 3/15/09 and you enter 30 into A1, 2/30/09 does not exist. It will return 3/2/09 (Feb 28 + 2). Is this good enough for your purposes?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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