+ Reply to Thread
Results 1 to 3 of 3

Looking for Explanation of SUMPRODUCT(--(Criteria), --(2nd Criteria))

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Looking for Explanation of SUMPRODUCT(--(Criteria), --(2nd Criteria))

    Hi,

    I was using COUNTIFS in Excel 2007 and searched for an equivalent that was compatible with 2003 when I stumbled upon SUMPRODUCT.

    Please Login or Register  to view this content.
    Does seem to work the same as:

    Please Login or Register  to view this content.
    Which is great... but I'm not content with it just working. I don't understand what the two dashes and extra parenthesis are meant to do. Maybe it's because it's late here that I'm not getting it, so if someone could elaborate I'd appreciate it.
    Last edited by yawnzzzz; 05-26-2010 at 08:22 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Looking for Explanation of SUMPRODUCT(--(Criteria), --(2nd Criteria))

    The extra parens force Excel to evaluate the logical expression within it correctly. See Help for About calculation operators. You can see how the formula evaluates without them using the Formula Auditing toolbar.

    The first "-" coerces the logical values True and False to -1 and 0 respectively; the second "-" converts the -1 and 0 to 1 and 0, the values useful in evaluating the rest of the expression.

    You could also rewrite the second expression as

    =SUMPRODUCT( (B3:B$65000=B2) * (H3:H$65000="Test"))

    In this case, it is the multiplication operator that causes the True and False results to be coerced to 1 and 0.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Looking for Explanation of SUMPRODUCT(--(Criteria), --(2nd Criteria))

    There's a very good in depth explanation of SUMPRODUCT here:

    http://www.xldynamic.com/source/xld.sumproduct.html

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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