alex
alex

Reputation: 11400

Excel: sum odd/even rows only in R1C1

How can I sum cells in odd/even rows only using R1C1?

I tried to follow this example. So suppose you have a table like this:

| 1 | 6 |
| 2 |
| 3 |

Then value 6 is the result of a formula:

=SUM(IF(MOD(ROW(RC[-1]:R[2]C[-1]),2)=1,RC[-1]:R[2]C[-1],0))

Even though it should give 4. What am I doing wrong?

Upvotes: 0

Views: 744

Answers (1)

Doug Glancy
Doug Glancy

Reputation: 27478

If you enter it as an array formula with Ctrl-Shift-Enter, it will produce the desired result.

Upvotes: 2

Related Questions