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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

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