Nesting SUMPRODUCT within SUMIF

giaudi

New Member
Joined
Jul 29, 2010
Messages
8
Hi guys, I need your help.

I'm trying to tell excel to SUMPRODUCT 2 arrays only if the code in a colum is equal to the one specified, but nesting sumproduct within sumif doesn't seem to be working

eg

columns A B C

x 3 2
y 2 5
x 5 5

I write:

=SUMIF(A:A;"x";SUMPRODUCT(B:B;C:C))

which should give the below result:

3*2 + 5*5 = 31

Do you ave any alternative?

Thanks in advance

G
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Why would you nest the 2 functions?

Just use SUMPRODUCT.

=SUMPRODUCT(--(A1:A3="x"), B1:B3, C1:C3)
 
Upvote 0
Hi

Just use Sumproduct:

=SUMPRODUCT((A1:A3="x")+0,B1:B3,C1:C3)

Note that if you are using xl2003 or below, you can't use whole column refs (such as A:A or B:B) in the Sumproduct - you need to explicitly define your range (eg A1:A3).
 
Upvote 0
Cool guys. Right, I was complicating it

And if I wanted to multiply numbers in column B by a constant number, say 10?
 
Upvote 0
Cool guys. Right, I was complicating it

And if I wanted to multiply numbers in column B by a constant number, say 10?

Underspecified...

Either (if column C is irrelevant)...

=SUMIF(A2:A1000,"X",B2:B1000)*10

Or...

=SUMPRODUCT(--(A2:A1000="X"),B2:B1000*10,C2:C1000)
 
Upvote 0
Hi

Also

=10*SUMPRODUCT(--(A2:A1000="X"),B2:B1000,C2:C1000) <!-- / message --><!-- sig -->
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,783
Members
449,049
Latest member
greyangel23

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
Back
Top