+ Reply to Thread
Results 1 to 9 of 9

Rolling 12 month Formula

  1. #1
    Registered User
    Join Date
    03-08-2008
    Posts
    20

    Rolling 12 month Formula

    Hi,
    I'm using a spreadsheet to record accident/incident frequency data, based on a rolling 12 month cycle.

    I require the current 12 months cycle (at this moment in time Feb12 to Jan13) to be highlighted, and then when we move into the next month, the next 12 months are automatically highlighted i.e. on the 1st Mar13 the 12 months highlighted would be Mar12 to Feb13 and so on.

    I suppose one problem would be, that I couldn't test the formula until the end of the month.

    Is there a formula available that would provide this requirement?

    Regards,

    Chris

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Rolling 12 month Formula

    Formula for:

    End of current month: =EOMONTH(TODAY(),0)
    Beginning of month a year ago: =EOMONTH(TODAY(),-12)+1
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-08-2008
    Posts
    20

    Re: Rolling 12 month Formula

    Many thanks for that...

    How would I apply that formula to the attached?

    Regards,

    Chris
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Rolling 12 month Formula

    Apply it how? Where? A good sample sheet has a mockup of the desired results that you've highlighted where you want help converting to a formula instead of your manual entry(s).

  5. #5
    Registered User
    Join Date
    03-08-2008
    Posts
    20

    Re: Rolling 12 month Formula

    Okay, so with the first formula, I could enter it into cells for the next
    12 months, and with the second formula, I could enter it into cells
    for the previous 12 months.
    I suppose they would eventually catch each other up, and I would
    have to amend the cells.

    Secondly, can a cell have more than one formula?

    Regards,
    Chris

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Rolling 12 month Formula

    Technically, the formula in a cell is ONE long formula, but within that formula you could construct IF/THEN tests to choose which part of the formula to actually DO.

    =IF(A1="dog", DoThisFormula, IF(A1="Cat", DoOtherFormula, DoSomethingElse))

  7. #7
    Registered User
    Join Date
    03-08-2008
    Posts
    20

    Re: Rolling 12 month Formula

    Hi again,

    Sorry to be a pain, but could you enter the identified formulas into my attached spreadsheet please. Once I see how you've entered them, I should be okay going forward.

    Many thanks in anticipation,

    Chris

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Rolling 12 month Formula

    Use conditional formatting (CF) across your range of data, Use the belwo formula in CF

    Please Login or Register  to view this content.
    format -- colour

    See attached (1st table). You can test the same by changing the system date to a different month on your PC/laptop. Hope this helps
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Rolling 12 month Formula

    The CF formula I would recommend is:

    =AND(C$3>=EOMONTH(TODAY(),-13)+1, C$3<EOMONTH(TODAY(),-1)+1)

+ 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