SUMPRODUCT using odd and even rows

Stan Dad

New Member
Joined
Aug 17, 2012
Messages
21
I have a column of numbers, say 1,2,3,4,5,6 in cells A1,A2,A3,A4,A5,A6. I want the sum of the alternating products, i.e. A1*A2+A3*A4+A5*A6. I have tried SUMPRODUCT(--(MOD(ROW(A1:A4),2)=1),A1:A4,--(MOD(ROW(A1:A4),2)=0),A1:A4) but this returns a zero value.

Any ideas?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Many thanks Steve, this works ... kinda.

The slight hesitation is because the formula works if the range starts on an odd-numbered row (A1, A3, etc), but not if it's an even numbered one. Until the relevant bit of the formula is amended to ISEVEN(ROW(A2:A7).

I posted a cut down version of my spreadsheet for simplicity, and I have several rows of other data above this; which means that every time I add a row above the formula, it will need to be amended accordingly. Is there a solution that isn't sensitive in this way?

This is not to take anything away form Steve's solution - I'm further forward than I was 12 hours ago: many thanks Steve.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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