+ Reply to Thread
Results 1 to 8 of 8

Formula to calculate 2 months prior to a date

  1. #1
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Buffalo, NY
    MS-Off Ver
    365
    Posts
    115

    Formula to calculate 2 months prior to a date

    Hello -

    Not sure if this is possible but I am trying to see if there is a formula that would automatically calculate the logic below:

    A1 = the review date (for this example let's say 3/17/16)
    B1 = the start of the lookback period (i.e. =TODAY()-1, 3/16/16)
    In C1 = I want to calculate 2 months prior to the lookback period, so 2 months from 3/16/16 is 1/16/16. Because the fluctuation in days in a month, just subtracting 60 from the lookback date will not work.

    Any ideas?

    thanks!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to calculate 2 months prior to a date

    Maybe this...

    =EDATE(B1,-2)

    Format as Date
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    279

    Re: Formula to calculate 2 months prior to a date

    Hmm, never knew about that EDATE Function before!

    Or =DATE(YEAR(B1),MONTH(B1)-2,DAY(B1))

  4. #4
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Buffalo, NY
    MS-Off Ver
    365
    Posts
    115

    Re: Formula to calculate 2 months prior to a date

    thank you guys, for now these do seem to work even if I use an April date which would result in a February (shorter month) result

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to calculate 2 months prior to a date

    Quote Originally Posted by EchoPassenger View Post
    Or =DATE(YEAR(B1),MONTH(B1)-2,DAY(B1))
    If the lookup back date was 8/31/2016 what date would be 2 months prior?

    There is no 6/31/2016. So, our choices are 6/30/2016 or 7/1/2016.

    EDATE returns 6/30/2016 and the MONTH(...)-2 method returns 7/1/2016.

    IMHO, the correct result should be 6/30/2016.

  6. #6
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Buffalo, NY
    MS-Off Ver
    365
    Posts
    115

    Re: Formula to calculate 2 months prior to a date

    Yes Tony you are correct, your formula is the one I am using.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to calculate 2 months prior to a date

    Good deal. Thanks for the feedback!

  8. #8
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    279

    Re: Formula to calculate 2 months prior to a date

    Quote Originally Posted by Tony Valko View Post
    If the lookup back date was 8/31/2016 what date would be 2 months prior?
    Very good point! Just one of a few reasons the calendar we use is a bit silly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 04-07-2016, 03:12 PM
  2. Help with formula to calculate quantity in prior months...
    By newcastle17 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-19-2012, 11:03 AM
  3. [SOLVED] Display cells 12 months prior and 12 months post from a given date
    By hog77 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-20-2012, 06:25 AM
  4. Given a date......find the same date two months prior to the given date
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2012, 11:24 PM
  5. Replies: 2
    Last Post: 01-04-2012, 09:15 AM
  6. Excel 2007 : Determine 2 months prior from a date
    By localhost in forum Excel General
    Replies: 2
    Last Post: 06-16-2010, 09:00 PM
  7. [SOLVED] Most simple formula to calculate date+ 30 months?
    By KR in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-28-2005, 03:05 PM

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