Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Combo Nested Formula: Rolling Avg and Column Letter Calculation needed please

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    21
    Rep Power
    0

    Combo Nested Formula: Rolling Avg and Column Letter Calculation needed please

    Is there a way for me to combine two of these formulas into one?

    I have a worksheeet called "Products" that has a rolling average calculation based on the input number value. So for example, if I want to look at 4 weeks rolling average, I just put 4 in AK4 and the Rolling average knows to pull only 8 weeks worth of data from Columns AN - BG.

    I also have another worksheet called "Executive Summary" that basically looks at a date and the formula will then go to the "Products" tab and match the date and then returns the column Letter for that date.

    What I need help with: I have a combo filter box that has the dates from the Products tab. I would like to calculate the rolling average of 4 weeks based on the dates that is selected on the Combo Filter. Here's another possible problem....if someone selected May 13 for example, you wouldn't be able to calculate the average b/c there's no data for the first 3 weeks prior, so maybe the formula can return a "N/A".

    Thank you in advance for anyone's help.

    Rolling Average Formula: =IFERROR(IF($A14="","",AVERAGE(OFFSET($AN14,0,COUN T($AN14:$BG14)-AK$1,1,AK$1))),0)

    Column Letter Forumula: =SUBSTITUTE(ADDRESS(1,SUMPRODUCT((Products!$AN$3:$ BH$3='Executive Summary'!$G$9)*(COLUMN(Products!$AN$3:$BH$3))),4), "1","")


    Dates on the Products tab: May 6 would be where column AN starts.
    6-May 13-May 20-May 27-May 3-Jun 10-Jun 17-Jun 24-Jun 1-Jul 8-Jul 15-Jul 22-Jul 29-Jul 5-Aug 12-Aug 19-Aug 26-Aug 2-Sep 9-Sep 16-Sep 23-Sep

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    =IFERROR(IF($A14="","",AVERAGE(OFFSET($AN14,0,AK2-AK1,1,AK$1))),0)

    where AK2 is the linked cell from your drop down (form control)

    if it's activex, get the date column index using

    =match(ak2,an3:bg3)

    and replace the highlighted range in the formula with this formula cell.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Junior Member
    Join Date
    Mar 2012
    Posts
    21
    Rep Power
    0
    Thank you that formula worked beautifully. However, if someone selected May 6, the formula gives me a circular error...Any way we can prevent that? Thanks so much for your additional help

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    what's the formula and in which cell ?
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  5. #5
    Junior Member
    Join Date
    Mar 2012
    Posts
    21
    Rep Power
    0
    The circular reference is in AK14

    =IFERROR(IF($A14="","",AVERAGE(OFFSET($AN14,0,MATC H('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1,1,AK$1))),0)

  6. #6
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    try

    =IFERROR(IF($A14="","",if(MATCH('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1>0,AVERAGE(OFFSET($AN14,0,MATCH('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1,1,AK$1))),0),0)
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  7. #7
    Junior Member
    Join Date
    Mar 2012
    Posts
    21
    Rep Power
    0
    GENIUS. IT WORKS! I am over the moon. Thanks so much. Question, if the May 6 date was picked, the result shows "FALSE"....Is there any way that I can have it show "N/A" instead? This will be displayed on a scorecard....and "false" looks odd. Thanks so much again.

  8. #8
    Junior Member
    Join Date
    Mar 2012
    Posts
    21
    Rep Power
    0
    One last question, the end result is off by one week. For example, if 9/16, the results starts counting from 9/16 and 4 previous weeks (which is 8/26, 9/2, 9/9, 9/16). Is there a way where the formula would actually start to count the week before? So if someone chose 9/16, the rolling 4 week average would include weeks of 8/18, 8/26, 9/2, 9/9? It would not include the 9/16 results...make sense?

    Sorry if I am making it a little more complicated, but the original formula above did this....Thank you in advance for your help. I TRULY appreciate this.

  9. #9
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    OK. it should be

    =IFERROR(IF($A14="","",IF(MATCH('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1>0,AVERAGE(OFFSET($AN14,0,MATCH('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1,1,AK$1)),NA())),0)

    Edit: just saw the additional requirement.

    See if this help.

    =IFERROR(IF($A14="","",IF(MATCH('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1>0,AVERAGE(OFFSET($AN14,0,MATCH('Executive Summary'!$H$9,$AN$3:$BG$3) -$AK$1-1,1,AK$1)),NA())),0)
    Last edited by Admin; 10-06-2012 at 11:11 PM.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  10. #10
    Junior Member
    Join Date
    Mar 2012
    Posts
    21
    Rep Power
    0
    OMG, you are super genius. IT WORKED> whew...thank thank you sooo much!

Similar Threads

  1. Nested If Formula With Multiple Conditions
    By lprc in forum Excel Help
    Replies: 10
    Last Post: 04-22-2013, 07:27 PM
  2. Formula Following Order Of Calculation BODMAS
    By paul_pearson in forum Excel Help
    Replies: 7
    Last Post: 03-27-2013, 02:07 PM
  3. Converting a Column Number to a Column Letter
    By Rasm in forum Excel and VBA Tips and Tricks
    Replies: 6
    Last Post: 12-17-2012, 02:29 AM
  4. Indirect Address Column Formula help needed
    By trankim in forum Excel Help
    Replies: 4
    Last Post: 10-13-2012, 02:15 PM
  5. Replies: 4
    Last Post: 09-26-2012, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •