+ Reply to Thread
Results 1 to 6 of 6

sumproduct syntax

  1. #1
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    sumproduct syntax

    Hello. I'm new to using sumproducts and I have a few question. I used the following formula (from a how to website on the use of sumproduct) to find a count of Ford cars with an "A" rating:
    =SUMPRODUCT((A9:A20="Ford")*(B9:B20="A")*(C9:C20)) on the table below. Question 1) Couldn't I just use a sumifs formula? 2) Why do I need to use the double parentheses after sumproduct? 3) How does the formula know to multiply the third condition (C9:C20) by the previous conditions? Thank you

    Ford B 3
    Vauxhall C 4
    Ford A 2
    Ford A 1
    Ford D 4
    Ford A 3
    Ford A 2
    Renault A 8
    Ford A 6
    Ford A 8
    Ford A 7
    Ford A 6

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: sumproduct syntax

    1 Yes you could use SUMIFS.

    2 The double parentheses close off the formula

    3 That's how SUMPRODUCT works, by multiplying the ranges you tell it to.
    If posting code please use code tags, see here.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: sumproduct syntax

    Most definitely SUMIFS, and since you have 2007+ it is way more efficient, but knowing SUMPRODUCT is still appropriate because you will run into situations where the SUMIFS will not work.

    =SUMIFS($C$9:$C$20,$A$9:$A$20,"Ford",$B$9:$B$20,"A")

    Basically the SUMPRODUCT produces a bunch of TRUE/FALSE and the * converts it into 1/0.

    Finally, all the 1/0 are multiplied by the last range which produces the final result.

    The best learning tool to see what is happening besides the link I shared earlier...

    EVALUATE FORMULA
    Click on the cell with the formula >> Ribbon >> Formulas >> Formula Auditing >> Evaluate Formula
    HTH
    Regards, Jeff

  4. #4
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Re: sumproduct syntax

    Thanks a lot. Very helpful.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: sumproduct syntax

    You are very welcome. Glad we could help

  6. #6
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: sumproduct syntax

    FYI

    Nice detailed explanation of SUMPRODUCT

    A very good way to really understand how Excel evaluates a formula is to use the Evaluate Formula feature and step through the formula and see the results return in each argument of a function.

    Ribbon Menu > Formulas > Evaluate Formula
    Last edited by Palmetto; 12-26-2012 at 09:03 PM.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ 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