sumproduct with non continuous ranges

atrianacpa

New Member
Joined
Jul 24, 2017
Messages
2
Hi Guys. I want to use sumproduct to add for me a non continuous range. For example, for the name Albert, I would like to add the sales from Jan thru March and then from June thru Aug.

A B C D E F G H I

Name Jan Feb Mar Apr May Jun Jul Aug

Albert 10 12 14 16 18 20 22 24

The answer should be : (10+12+14) + (20+22+24) = 102

I tried the following : sumproduct(--(A1:A2 ="Albert")*(B2:D2)*(G2:I2) But that gives me an NA and does not work. Any suggestions?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Maybe:

Excel 2012
ABCDEFGHIJK
1NameJanFebMarAprMayJunJulAug
2Albert1012141618202224102
3Belle12345678

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
K2=SUMPRODUCT(B2:I3*{1,1,1,0,0,1,1,1}*(A2:A3="Albert"))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Maybe:

Excel 2012
ABCDEFGHIJK
1NameJanFebMarAprMayJunJulAug
2Albert1012141618202224102
3Belle12345678

<tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
K2=SUMPRODUCT(B2:I3*{1,1,1,0,0,1,1,1}*(A2:A3="Albert"))

<tbody>
</tbody>

<tbody>
</tbody>
Wow, that was brilliant, assigning true and false values to each month included or excluded. Thank you !!
 
Upvote 0

Forum statistics

Threads
1,215,127
Messages
6,123,203
Members
449,090
Latest member
bes000

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