Sumproduct

Zot

Well-known Member
Joined
Nov 26, 2020
Messages
2,272
Office Version
  1. 2016
Platform
  1. Windows
Discussion split from this thread: ADD A RANGE OF CELLS FROM MULTIPLE COLUMNS BASED ON CRITERIA FROM ONE COLUMN

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I also suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.


Try
Excel Formula:
=SUMPRODUCT((F5564:F5568="CC")*EL5564:EP5568)
This formula works in 365? This is good. I'm still in 2016 :(
 
Last edited by a moderator:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
No. It did not work. Get #VALUE!
Sorry, I don't have 2016 to test with.

Here is mine

21 01 06.xlsm
CDEFEKELEMENEOEP
556545CC26941
5566DD93557
5567CC28652
5568
Sumproduct
Cell Formulas
RangeFormula
C5565C5565=SUMPRODUCT((F5564:F5568="CC")*EL5564:EP5568)
 
Upvote 0
Sorry, I don't have 2016 to test with.
SumProduct works if array is single column but not across several columns (2 dimensional) without Ctrl+Shift+Enter since it is an array formula. I have no idea 365 can do that
 
Upvote 0
SumProduct works if array is single column but not across several columns (2 dimensional) without Ctrl+Shift+Enter since it is an array formula.
It seemed to work across multiple columns back in 2012 well before excel 2016:

Do you have any text or error values in EL5564:EP5568?
 
Upvote 0
Here I recreated a sample

Book1.xlsm
CDEFG
15CC10000
16CA01000
17CC00100
18
19#VALUE!
20#VALUE!
Sheet8
Cell Formulas
RangeFormula
E19E19=SUMPRODUCT(C15:C17="CC",E15:G17)
E20E20=SUMPRODUCT(C15:C17="CC",E15:G17)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
I see. It works if use like your formula =SUMPRODUCT((C15:C17="CC")*E15:G17)

Cannot use like regular SumProduct with just comma
 
Upvote 0
Those are not in the same format as my formula. Look more closely. :)
 
Upvote 0
I see. It works if use like your formula =SUMPRODUCT((C15:C17="CC")*E15:G17
Cannot use like regular SumProduct with just comma
Sorry, I missed that post when making my last one. No you cannot, because SUMPRODUCT can only work with numbers, not TRUE/FALSE values which must be coerced to numbers.
You could use commas like this
Excel Formula:
=SUMPRODUCT(--(C15:C17="CC"),E15:G17)
 
Upvote 0

Forum statistics

Threads
1,215,241
Messages
6,123,823
Members
449,127
Latest member
Cyko

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