Simplifying a SUM function?

  • Thread starter Thread starter brunnle2
  • Start date Start date
B

brunnle2

Have the following SUM function:
=SUM(D151+D149+D147+D145+D143+D139+D137+D135+D133+D131+D129+D127+D123+D121+D119+D115+D113
etc, etc.)

Is there an easier way to write a function that does the same SUM
 
Hi
one way if you want to sum all odd rows:
=SUMPRODUCT((MOD(ROW(D113:D151),2)=1)*(D113:D151))
change the range D113:D151 to your needs
 
Hi brunnle2:

Try:

=SUMPRODUCT((D1:D151)*(MOD(ROW(D1:D151),2)))


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Frank

Only problem is the 143+139 and the 127+123 throw the "every odd row" out of
whack.

Or perhaps a typo and OP did mean every second row??

I guess we'll find out.

Gord
 
Gord
you're right. Only read the first and the last parameters in his
formula :-)
But the OP has not complained <vbg>
 
Maybe hasn't noticed, or it was a couple of typos.

They definitely looked out of sequence.

Gord
 
Back
Top