sum product if

R

r2rcode

i need a formula to sum a product of the info in two columns based on meeting
the if criteria. i have tried to use a combination of the SUMPRODUCT AND
SUMIF without success. For example
Column 1 Column 2 Column 3
State Hours Rate
PA 2 $50
PA 1 $10
NJ 4 $20
MD 3 $40
NJ 1 $10
PA 2 $10

I would like a formula to put in a cell to automatically look down column 1
("state") and sum the products of the "hours" and "rates" for a particular
state. PA: 2*$50 + 1*$10 + 2*$10 = $130.
 
R

ryguy7272

With data in A1:C7, put this function in cell E2:
=SUMPRODUCT(--(A2:A7="PA"),(B2:B7)*(C2:C7))

HTH,
Ryan---
 
R

r2rcode

perfect... thanks for your help

ryguy7272 said:
With data in A1:C7, put this function in cell E2:
=SUMPRODUCT(--(A2:A7="PA"),(B2:B7)*(C2:C7))

HTH,
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top