|  

» Modifying a SUMPRODUCT function to Return a Sum Rather than a Count

Problem:

Columns B & C list the prices and categories of various items sold.
Column A contains the ID of the salesperson who sold each item.
The following formula was created to count the number of "A" category items that were sold by salesperson "1".
=SUMPRODUCT((A2:A9=1)*(B2:C9="A"))
We want to modify the formula so that it calculates the sum of the prices of all items meeting the above criteria.

Solution:

To cause the SUMPRODUCT formula to sum the values from a range instead of counting them, add another argument to the SUMPRODUCT formula that contains the range to sum (cells C2:C9):
=SUMPRODUCT((A2:A9=1)*(B2:B9="A")*C2:C9)


Rate This Tip
12 34 5
Rating: 4.00     Views: 16235
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments