+ Reply to Thread
Results 1 to 8 of 8

Combining Sumproduct with an aggregate formula

  1. #1
    Registered User
    Join Date
    01-03-2022
    Location
    DK
    MS-Off Ver
    Microsoft 365 Subscription
    Posts
    11

    Combining Sumproduct with an aggregate formula

    Hi

    I'm trying to write a function that will look for input (exercise) in column B:B. Each exercise have two corresponding rows. One for KGs and one for Reps.
    When there is a match, the function should calculate a sumproduct of the two rows with KGs and Reps.

    The issue is, when there are multiple matches in column B:B my formula will only calculate the sumproduct for the first match.
    Is there a way to fix this?

    This formula calculates the SUMPRODUCT of my rows, but only one match.
    Please Login or Register  to view this content.
    This formula finds the rows where the input matches up with column B:B
    Please Login or Register  to view this content.
    Is it possible to combine the two above formulas, or is there a better way?



    Thanks in advantage
    Attached Files Attached Files

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Combining Sumproduct with an aggregate formula

    Al the 3 cells in one formula: Please empty cells G21 and G22 and try in G20
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-03-2022
    Location
    DK
    MS-Off Ver
    Microsoft 365 Subscription
    Posts
    11

    Re: Combining Sumproduct with an aggregate formula

    Thanks a lot HansDouwe. Your formula works great


    In the data t;F4:K13 for KGs and reps, I have formulas like this on, =IF(AA99=0;"";AA99) where it return "" instead of a 0. Right now, this breaks your formula.

    Is it possible to change it, so "" are ignored?


    Thanks

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Combining Sumproduct with an aggregate formula

    I don't understand what you mean. SUM ignores "".
    Please add a sample sheet with expected results.

  5. #5
    Registered User
    Join Date
    01-03-2022
    Location
    DK
    MS-Off Ver
    Microsoft 365 Subscription
    Posts
    11

    Re: Combining Sumproduct with an aggregate formula

    I have added some "hidden" cells to the file.
    In my own file these cells are a used to set reps and add weight increments. Based on these cells, I use the formula =IF(F5=0;"";F5) to get the reps and KGa to the array your formula did magic on

    The problem is, when I have "hidden" cells with no information, this breaks the formula and it returns an #VALUE! error.

    I hope it makes sense with the file.


    Thanks
    Attached Files Attached Files

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Combining Sumproduct with an aggregate formula

    Oh I See, if you put "" in a cell with a formula you get the problem.
    I also find it strange that Excel ignores a really blank cell, but #VALUE causes, when "" are put in by a formula.

    There 2 different solutions:
    1. Don't put "" in a cell with a formula, but a zero and custom format the zeros invisible (custom format 0;; )
    2. Or try this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    NOTE: The range t of the formula is now J4:O13. I think you mean K4:O13.
    Attached Files Attached Files
    Last edited by HansDouwe; 09-23-2023 at 05:06 PM.

  7. #7
    Registered User
    Join Date
    01-03-2022
    Location
    DK
    MS-Off Ver
    Microsoft 365 Subscription
    Posts
    11

    Re: Combining Sumproduct with an aggregate formula

    Thanks a lot HansDouwe. That fixed it

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Combining Sumproduct with an aggregate formula

    Thanks for the feedback and rep . Glad to have helped.

+ 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] Combining Aggregate with IF/AND functions
    By PhillyVictoria in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-26-2023, 10:02 PM
  2. Combining INDEX & AGGREGATE for two different sources
    By lozg43 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-10-2022, 07:42 AM
  3. [SOLVED] Google Sheets: Combining SUMPRODUCT, AVERAGEIF and Wildcards in a single formula
    By Sleurgh in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 02-27-2022, 10:16 PM
  4. Combining SUMPRODUCT, AVERAGEIF and Wildcards in a single formula
    By Sleurgh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-24-2022, 03:19 AM
  5. [SOLVED] Combining SUMPRODUCT and MAX
    By DeZeeuw2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-10-2015, 01:06 PM
  6. sumproduct, combining 2 formula
    By onthecauseway in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2011, 07:54 AM
  7. Combining AND,SUMPRODUCT & IF
    By reggie1000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-14-2008, 09:35 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