+ Reply to Thread
Results 1 to 5 of 5

Rolling months based on date

  1. #1
    Registered User
    Join Date
    02-14-2008
    Location
    South Africa, Pretoria
    MS-Off Ver
    2010
    Posts
    47

    Rolling months based on date

    Hi Folks,

    My challenge is the following:

    I would like the spreadsheet values in F8 to F19 to change based on the date I place in cell B2.

    So if I select January 2014 for example then the value in B19 changes to the previous month ( December 2013) and the value would be that in calculated in AP3 would appear in F19

    and if I select February 2014 then the value of AP3 would be place in the cell F18.

    I think there might be simpler way of doing things and look forward to your inputs
    Attached Files Attached Files
    Regards
    Rob

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Rolling months based on date

    small steps...

    1. change B19 to this...
    =EDATE($B$2,-1)
    Then change B18 to this, and copy upwards...
    =EDATE(B19,-1)

    2. In F8, copy this down...
    =INDEX($AE$4:$AP$4,MATCH(TEXT(B8,"mmm"),$AE$3:$AP$3,0))

    edit: Hoe gaan dit daai kant van die groot water? SA ex-part here from PE and Klerksdorp
    Last edited by FDibbins; 11-13-2014 at 01:23 AM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    02-14-2008
    Location
    South Africa, Pretoria
    MS-Off Ver
    2010
    Posts
    47

    Re: Rolling months based on date

    Thanks for the prompt reply.

    I have made the changes suggested.

    The values in column F do no change according to the month change.

    Good to hear from a fellow SA citizen - dit gaan goed dankie
    Last edited by Rob (SA); 11-13-2014 at 01:33 AM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Rolling months based on date

    OK Im not really sure what you are trying to do here (it's getting late and maybe Im not reading stuff right = moeg geploeg lol), but hile trying to figure things out, I have simplified some formulas for you.

    AE4=SUMPRODUCT(--(TEXT($B$24:$B$227,"mmm")=AE$3),$F$24:$F$227)

    If you want the values in AE4:AP4 to change when you change the date in B2, then you need to use what I suggested for the dates in B19 upwards there as well, so that they change...
    AP3=EDATE($B$2,-1)
    AO3=EDATE(AP3,-1) copied back
    If you do that, then you can replace the sumproduct with this, copied across...
    =SUMIF($B$24:$B$227,AE$3,$F$24:$F$227)

    A word of advice - when working with dates, try and keep all dates as real dates, not text dates. "Jan" is text, and excel doesnt really know that it is a month name/date, but 1/1/2014 is a real date, and excel has a bunch of formulas that can be used based on that. So for instance, in your SUMPRODUCT(), you had to build in a function to convert a date to text TEXT(B8,"mmm"), but if they were all dates, that would not be needed.

    Anyway, having said all that, try applying the changes I have suggested, then see if you can adapt them to what you need. If you still have a problem, shout again - with samples of what you are changing, and what you expect, and I will take another look later.
    *bed calling now lol*

  5. #5
    Registered User
    Join Date
    02-14-2008
    Location
    South Africa, Pretoria
    MS-Off Ver
    2010
    Posts
    47

    Re: Rolling months based on date

    Thanks for the good advice.

    I continued with your previous post and made the following change

    =INDEX($H$3:$S$3,MATCH(TEXT(B16,"mmm"),$AE$3:$AP$3,0))

    and this seems to be working for the top section, now I need to make it work for the lower sections in the worksheet.

    Thanks for the offer of continued support.

    Lekker slaap
    Last edited by Rob (SA); 11-13-2014 at 03:47 AM.

+ 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. Is there a way to do conditionally formatting based on a rolling date?
    By Drogo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2014, 10:44 PM
  2. [SOLVED] How to change cell value based on 12 months rolling date on other cell
    By buznac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-31-2013, 07:30 PM
  3. Rolling sum of 12 months against each month based on two criteria
    By agupta5231 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2013, 12:01 AM
  4. Replies: 0
    Last Post: 06-27-2012, 08:38 PM
  5. rolling 12 months
    By D in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

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