=sumproduct

GigEm

New Member
Joined
Dec 6, 2011
Messages
8
My goal is to sum the product of two numbers on a data entry sheet, given the entry meets certain criteria, and display the answers on a sum sheet separated by size and material type. Here is the formula so far...

=SUMPRODUCT(--('Piping Takeoff'!J15:J24="bwsw"),--('Piping Takeoff'!H15:H24=0),--('Piping Takeoff'!K15:K24=0.5),'Piping Takeoff'!K15:K24*'Piping Takeoff'!M15:M24)

J15:J24 is weld type
H15:H24 is the material type
K15:K24 is the pipe size

The formula works as is, but I need to change one thing for it to suit my needs. Rather than summing data if the weld type (J15:J24) ="bwsw", I need it to sum the data if the weld type matches any of a list (Y2:Y59) of text strings, i.e. "bwsw", "bwxs", "swxs".

Substituting "bwsw" for Y2:Y59 does not work.
=SUMPRODUCT(--('Piping Takeoff'!J15:J24=Y2:Y59),--('Piping Takeoff'!H15:H24=0),--('Piping Takeoff'!K15:K24=0.5),'Piping Takeoff'!K15:K24*'Piping Takeoff'!M15:M24)

I realize I could include all 57 of the weld types with "" and ,'s but I'm looking for the proper way to include a list in the =sumproduct function.

Thanks.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Try...

=SUMPRODUCT(--ISNUMBER(MATCH('Piping Takeoff'!J15:J24,Y2:Y59,0)),--('Piping Takeoff'!H15:H24=0),--('Piping Takeoff'!K15:K24=0.5),'Piping Takeoff'!K15:K24,'Piping Takeoff'!M15:M24)
 

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
GigEm,

Maybe this will give you an idea:

=SUMPRODUCT(--($D$5:$D$162={"cri","maj","enh","min"})*($J$5:$J$162="DataContent")*($Y$5:$Y$162))
 

GigEm

New Member
Joined
Dec 6, 2011
Messages
8
Try...

=SUMPRODUCT(--ISNUMBER(MATCH('Piping Takeoff'!J15:J24,Y2:Y59,0)),--('Piping Takeoff'!H15:H24=0),--('Piping Takeoff'!K15:K24=0.5),'Piping Takeoff'!K15:K24,'Piping Takeoff'!M15:M24)

That is exactly what I needed. Thank you. I had just used that recently too!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,683
Messages
5,838,792
Members
430,569
Latest member
sbardelli

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top