+ Reply to Thread
Results 1 to 11 of 11

Sumproduct with Multiple Criteria to a calculate a moving average based on a range

  1. #1
    Registered User
    Join Date
    02-20-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    74

    Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Hi, I am trying to use sumproduct to calculate a moving average matching a set of criteria. Here is my formula and i am attaching a version of the excel workbook. I am using excel 2010.

    =SUMPRODUCT(--('Weekly Vol Pivot'!$B$12:$B$300>=(MAX(IF('Weekly Vol Pivot'!$B$12:$B$300=CONCATENATE(VLOOKUP($D$5,Lookup!$C$17:$D$28,2,FALSE),$D$6),'Weekly Vol Pivot'!$B$12:$B$300))-42)),--(('Weekly Vol Pivot'!$B$12:$B$300= CONCATENATE(VLOOKUP($D$5,Lookup!$C$17:$D$28,2,FALSE),$D$6))),--('Weekly Vol Pivot'!$N$12:$N$300))/6

    Please help.
    Attached Files Attached Files

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Hi Krunk,

    Where to look in the workbook.... Which cell has this formula?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Maybe something like this (pivot table)
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-20-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Quote Originally Posted by dilipandey View Post
    Hi Krunk,

    Where to look in the workbook.... Which cell has this formula?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

    It is cell d21, and also the one that has the #N/A formula.

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Okay.. and what should be the answer in that cell ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  6. #6
    Registered User
    Join Date
    02-20-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Does anyone have any suggestions? I really need this formula to work?

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    If you don't reply to the question in #5, I would not know what you want to achieve.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  8. #8
    Registered User
    Join Date
    02-20-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    The answer should be to find the sum of the previous 3 (06week4) from a range then sum them then divide by 3 to provide the average. So on the tab labeled "weekly vol Pivot" column M holds the (month&Week combination) and n has the values that i would like to sum. I need it to find the previous 3 values that match the (month&Week combination) excluding the most recent match and divide by 3. Hopefully this makes more sense. I can't change the pivot becuase i have other values that are linked to it. I want to put the formula on the "summary" tab in cell 21 which right now hold an #N/A with the formula that i tried. Any help or insight that you can provide would be greatly appreciated. Just in case here is the formula again..

    =SUMPRODUCT(--('Weekly Vol Pivot'!$B$12:$B$300>=(MAX(IF('Weekly Vol Pivot'!$B$12:$B$300=CONCATENATE(VLOOKUP($D$5,Lookup!$C$17:$D$28,2,FALSE),$D$6),'Weekly Vol Pivot'!$B$12:$B$300))-21)),--(('Weekly Vol Pivot'!$B$12:$B$300= CONCATENATE(VLOOKUP($D$5,Lookup!$C$17:$D$28,2,FALSE),$D$6))),--('Weekly Vol Pivot'!$N$12:$N$300))/3

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    You did not reply on the answer in #3.

  10. #10
    Registered User
    Join Date
    02-20-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    I can't changed the Pivot Table since i have other cells referencing the table. Plus, id really like to use this formula so that every month i don't have to be constantly updating the formula or lookup's.

    Hoping you can help me.

    Thanks again!

  11. #11
    Registered User
    Join Date
    02-20-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: Sumproduct with Multiple Criteria to a calculate a moving average based on a range

    Please, does anyone have any other suggestions or advice? Or know of another forum that can help?

+ 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