[quote=“Gary “Wombat” Robson, post:9, topic:556458”]
I tried Palooka’s approach and can’t get it to work. If I put…
=SUM(IF(MOD(COLUMN(E8:AA8),2)=0,E8:AA8,0))
I get zero. If I change the =0 to an =1, I get the sum of all columns, odd or even.
[/quote]
To understand Palooka’s approach, you have to notice that he said it’s an “array formula.” This is an advanced feature of Excel that allows one formula to make the same calculation over an entire array of cells, and is effectively iteration.
But it requires one little extra move to enter it. Once you type the formula in, you have to hit CTRL-SHIFT-ENTER. If you just hit ENTER, you get a plain vanilla formula.
You can achieve the same effect with a formula you’ve already written by hitting F2 to edit the formula then CTRL-SHIFT-ENTER.
If you do this properly, you will see
{=SUM(IF(MOD(COLUMN(E8:AA8),2)=0,E8:AA8,0))}
in the formula box. But you can’t just type in brackets, that won’t work. You have to use CTRL-SHIFT-ENTER.
But I’m still advocating a change in format. If you do it like this (same data as your example):
Date Item Qty Cost
1/5/2010 ITEM1 3 6.00
3/14/2010 ITEM1 2 4.04
4/23/2010 ITEM1 4 7.92
3/14/2010 ITEM2 12 48.48
1/5/2010 ITEM3 1 19.93
4/34/2010 ITEM3 1 19.96
then you can use a pivot table, which is much more flexible and powerful than anything you can do messing around with formulas.