formula for sumproduct

C

Curtis

Is there any way to use two cell for sumproduct?
= SUMPRODUCT(--(A2:A100=A2),C2:C100) this is the formula I am using, what I
am trying to do is add another cell with A2. Need to have column A and B to
do the sumproduct. Column A is for states, column B is for type of fuel and
column C for gallons. If A is TX and B is red dye fuel, C is 80 gal. If A is
TX and B is diesle and C is 200 gal. If A is OK and B is diesel and C 150
gal. Have total on bottom and trying to keep states and type fuel seperate in
total cell. Any help on this?
 
P

Peo Sjoblom

= SUMPRODUCT(--(A2:A100="TX"),--(B2:B100="red dye fuel"),C2:C100)

or better

= SUMPRODUCT(--(A2:A100=D1),--(B2:B100=E1),C2:C100)

where D1 holds the state you want and E1 the type of fuel
 

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