Sum every other column - offset function?

caststone

New Member
Joined
Feb 3, 2015
Messages
17

Excel 2010
ABCDEFGHIJK
1week nodaysweek nodaysweek nodaysweek nodaysweek nodays
20
Sheet1

In the simplified table above I am looking to sum all the values in the blue cells(every other column) and show the resulting value in the red cell.

It would seem as simple as =sum(C2+E2+G2+I2+K2)

However the problem I have is that each week I insert a new pair of columns after column A. This means that the formula above allows for the column insertion and changes to =SUM(E2+G2+I2+K2+M2).

I have tried using absolute column references =sum($C2+$E2+$G2+$I2+$K2) but this has no effect.

I have looked at the offset function which seems at least to address the issue of the formula changing as columns are inserted but I cannot understand how to make this work for my particular example.

Any help gratefully received.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
This will do 100 or so columns:

=SUMPRODUCT(--(MOD(COLUMN($C$2:$CZ$2),2)=1),$C$2:$CZ$2)
 
Upvote 0
Thank you very much. Both these formulas are a neat way to sum every other column but as soon as I insert two new columns after column A the formula is 'transposed' (if that is the right word) -

e.g. =SUMPRODUCT(--(MOD(COLUMN($E$2:$M$2)-COLUMN($E$2),2)=0),$E$2:$M$2)

I want it to continue summing C through K, not move to E through M.

Does that make sense?
 
Upvote 0
Again, cracking way to sum the columns until I insert new columns after column A and

=SUMIF($C$1:$CZ$1,"Days",$C2:$CZ2)

Becomes -

=SUMIF($E$1:$DB$1,"Days",$E2:$DB2)
:(
 
Upvote 0
This wont change but will slow your book down.

INDIRECT("$C$1:$CZ$1")
 
Upvote 0
Thank you Jonmo1, that worked a treat!

Just out of interest Steve - I have never seen 'Indirect' before. What does this do?
 
Upvote 0
Thank you Jonmo1, that worked a treat!

You're welcome...

Please note, according to your original post, you're actually putting the formula in cell A2..
The last formula I posted works fine, so long as A1 does NOT = "Days"
If you put "Days" in A1, then it becomes a circular reference error..
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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