"Kanga 85" wrote
....
This formula seems to work well for positive numbers,
but does not seem to work if the range includes
some negative numbers.
Puzzled by the above ..
The suggested formula
(for say, a smaller spread of 6 cols: A to F, to illustrate)
=SUMPRODUCT(--(MOD(COLUMN(A1:F1),2)=1),A1:F1)
would simply reduce to
=SUMPRODUCT({1,0,1,0,1,0},A1:F1)
which would then evaluate as:
= 1xA1 + 0xB1 + 1xC1 + 0xD1 +1xE1 + 0xF1
= A1 + C1 + E1
and should return the final outcome correctly
irrespective of whether A1, C1, E1 contains
negative or positive numbers.
Text will be ignored.
If the summation seems not to add up correctly,
then maybe some "numbers" in the target range are
not really numbers, but text ??
(e.g.: '-9, '-3, '9 < entered with preceding apostrophes
in cells will be ignored in the SUMPRODUCT)
Try this experiment on a copy of your sheet:
Suppose your target range to add all the alternate cells
is in A1:Z1
Put in A2: =A1+0, copy across to Z2
(this will coerce any "text" numbers in A1:Z1 to real numbers)
Sum A2:Z2 up in say, A3:
=SUMPRODUCT(--(MOD(COLUMN(A2:Z2),2)=1),A2:Z2)
Now sum up the original target range in say, A4:
=SUMPRODUCT(--(MOD(COLUMN(A1:Z1),2)=1),A1:Z1)
If A3 < A4, then you've got some text numbers
in the target range ..
Merry Christmas !
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
|