+ Reply to Thread
Results 1 to 8 of 8

Get SUMPRODUCT change dynamicaly with filters

  1. #1
    Registered User
    Join Date
    05-17-2019
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    4

    Get SUMPRODUCT change dynamicaly with filters

    Hi, this my problem.

    I have an SUMPRODUCT working on a formula but I need to make it change dynamicaly with filters.

    This is the part of my formula: SUMPRODUCT(($H9:$H5001)*(M9:M5001<>""))

    All the formula for the context, it's calculating an weight average:

    =SUMPRODUCT((SUBTOTAL(9;OFFSET($H9:$H5001;ROW($H9:$H5001)-MIN(ROW($H9:$H5001));;1)))*(M9:M5001))/SUMPRODUCT(($H9:$H5001)*(M9:M5001<>""))

    Thanks by advance.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Get SUMPRODUCT change dynamicaly with filters

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    05-17-2019
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Get SUMPRODUCT change dynamicaly with filters

    Sorry, here is sample of my rows with my formulas.

    And it's supposed to work with something arround 3000 rows.

    Thanks by advance.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Get SUMPRODUCT change dynamicaly with filters

    So... you want an average of visible cells only?? Or something else??

  5. #5
    Registered User
    Join Date
    05-17-2019
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Get SUMPRODUCT change dynamicaly with filters

    Thanks for replying.

    My weight average is working actually, but if add some filters it's not working anymore.

    The problem is the last part of the formula with only a sumproduct, it's not filter friendly and i need this condition for empty cells.

    I hope it's understandable.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Get SUMPRODUCT change dynamicaly with filters

    Ummm. I'm not suree what you mean, as you haven't provided expected answers for representative scenarios. This is a guess!!


    =SUMPRODUCT((SUBTOTAL(9,OFFSET(A6:A21,ROW(A6:A21)-MIN(ROW(A6:A21)),,1)))*(B6:B21))/SUMPRODUCT(SUBTOTAL(9,OFFSET(A6:A21,ROW(A6:A21)-ROW(A6),0,1))*(B6:B21<>""))

  7. #7
    Registered User
    Join Date
    05-17-2019
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Get SUMPRODUCT change dynamicaly with filters

    That's working great !

    Thanks a lot.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Get SUMPRODUCT change dynamicaly with filters

    Lucky guess!!

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] Sumproduct that filters out errors vlaues
    By Craig K. in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-21-2013, 04:23 PM
  2. [SOLVED] SUMIFS, SUMPRODUCT with filters etc
    By BC Rob in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-06-2013, 02:49 PM
  3. SUMPRODUCT Function with Filters
    By R_ka_Tect in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-18-2013, 10:03 AM
  4. dynamicaly changing diagrams
    By jamalsid in forum Excel General
    Replies: 1
    Last Post: 09-03-2011, 06:13 AM
  5. Change pivot table filters on VBA userform combox box change?
    By Teemu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-16-2011, 05:49 AM
  6. SUMPRODUCT and filters
    By richandjo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2011, 03:48 PM
  7. CAN YOU DYNAMICALY CHANGE VLOOKUP SEARCH RANGE?
    By njuneardave in forum Excel General
    Replies: 3
    Last Post: 06-21-2006, 02:45 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