+ Reply to Thread
Results 1 to 5 of 5

SumProduct Not Calculating

Hybrid View

  1. #1
    Registered User
    Join Date
    03-02-2010
    Location
    Massachusetts, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    SumProduct Not Calculating

    Hi,

    I created a sumproduct formula to calcualte the averages, but it doesn't work. I think I got the formula right. Can some please tell me what is wrong with it? Attached is the formula, in highlighted yellow cells.

    Please help,
    Dee
    Attached Files Attached Files
    Last edited by N0b0dyzAngel; 08-31-2010 at 09:31 PM.
    Dee

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: SumProduct Not Calculating

    Your syntax is wrong...

    Here, try this in B4 and adopt for other:

    =SUMPRODUCT(--($A$9:$A$39>=$B$1),--($A$9:$A$39<=$C$1),$B$9:$B$39)/SUMPRODUCT(--($A$9:$A$39>=$B$1),--($A$9:$A$39<=$C$1),--($B$9:$B$39<>""))
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    03-02-2010
    Location
    Massachusetts, United States
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: SumProduct Not Calculating

    Thanks Zbor. It works! Can you tell me what is the difference between the -- and the * symbols in the SumProduction function?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: SumProduct Not Calculating

    Using -- is just slightly better.

    Here is what Donkeyote said about it:

    If you use the above method then you can include the header row without issue... but double unary approach means each array must identical in terms of dimensions

    If you use the multiplication method (which does not nec. have this requirement) then it follows given the explicit coercion taking place your summation range should not include non-numerics.

    Basic example:

    =SUMPRODUCT(--({TRUE,FALSE,TRUE}),--({TRUE,TRUE,TRUE}),{"a",1,2}) -> 2

    the "a" in the summation range will be ignored in similar vein to a SUMIF ignoring non-numerics in sum_range (no explicit coercion taking place)

    Conversely

    =SUMPRODUCT({TRUE,FALSE,TRUE}*{TRUE,TRUE,TRUE}*{"a",1,2}) -> #VALUE!

    the "a" here causes an issue as it's explicitly coerced given * - hence 1*"a" -> #VALUE!

    For more info. on SUMPRODUCT see Bob Phillips' white paper: http://www.xldynamic.com/source/xld.SUMPRODUCT.html

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: SumProduct Not Calculating

    Needs to be "array entered" but for averages why not use AVERAGE?

    =AVERAGE(IF($A$9:$A$39>=$B$1,IF(A$9:$A$39<=$C$1,IF($B$9:$B$39<>"",$B$9:$B$39))))
    Audere est facere

+ 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