Sum alternate columns with dynamic range

nanjundas

New Member
Joined
Jun 14, 2018
Messages
2
I have a excel sheet having monthwise sales (qty and value) in column against each item in row. I need to sum the alternate column (i.e qty and value seperately). I am using the formula "=SUMPRODUCT(--(MOD(COLUMN(D4:AA4)-COLUMN(D4)+1,2)=0),D4:AA4 " which gives total of all the qty and value individually.
I need to make the range D4:AA4 as dynamic based on the cell values. (if i want to refer to Q4 or S4 in place of AA4)

Can anyone help me out.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
In B4 enter and copy down:

=MATCH(9.99999999999999E+307,D4:XFD4)

In C4 enter and copy down:

=SUMPRODUCT(--(MOD(COLUMN(D4:INDEX(D4:XFD,B4))-COLUMN(D4)+1,2)=0),D4:INDEX(D4:XFD,B4)
 
Upvote 0

Forum statistics

Threads
1,224,798
Messages
6,181,038
Members
453,014
Latest member
Chris258

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