Simplifying a SUM function?

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
 
F

Frank Kabel

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
 
N

Norman Harker

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.
 
G

Gord Dibben

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
 
F

Frank Kabel

Gord
you're right. Only read the first and the last parameters in his
formula :)
But the OP has not complained <vbg>
 
G

Gord Dibben

Maybe hasn't noticed, or it was a couple of typos.

They definitely looked out of sequence.

Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top