Function question

T

Tim

I want to take a number and then do a sum similiar to a factorial.

Example:

In cell A1 I input 5

then in cell A2 the function adds 5+4+3+2+1

if I put in 3 it adds 3+2+1

is there a function that does this?
 
J

joeu2004

Tim said:
I want to take a number and then do a sum similiar to a factorial.
Example:
In cell A1 I input 5
then in cell A2 the function adds 5+4+3+2+1
if I put in 3 it adds 3+2+1
is there a function that does this?

Function? I don't know. But there is a well-known formula
for this sum. In Excel, it would be:

=A1*(A1+1)/2
 
D

Dave Peterson

=a1*(a1+1)/2

It's a neat formula that some kid figured out a long time ago...

Say you want to add 1+2+3+4+5+6+...+100
Call that Sum S

We can write it two ways:
S = 1 + 2 + 3 + ... + 100
S = 100 + 99 + 98 + ... + 1

We add those two lines and we get:

2*S = 101 + 101 + 101 + ... + 101 (100 times)
so
2*S = 100 * 101

S = 100 * 101 / 2

Replace that 100 with an arbitrary N:

S = N*(N+1)/2
 
B

Bob Phillips

=SUMPRODUCT(--(ROW(INDIRECT("1:"&A1))))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
B

Bill Martin

The kid was Issac Newton. The story is that as punishment the teacher told
the whole class to add up the numbers from 1 to 100. Newton stared at it a
bit and just wrote down the answer. You can imagine the teacher's
response.

Bill
--------------------
 
D

Dave Peterson

I think it was Carl Friedrich Gauss, actually.

Bill said:
The kid was Issac Newton. The story is that as punishment the teacher told
the whole class to add up the numbers from 1 to 100. Newton stared at it a
bit and just wrote down the answer. You can imagine the teacher's
response.

Bill
 
D

Dave Peterson

Even though the link has Newton in its address, it still refers to Gauss <vbg>.
 
B

Bill Martin

You're absolutely right! Somehow I've apparently had that wrong for 30
years. Makes me wonder what else I "know that isn't true?

Thanks.

Bill
-----------------------
 
Top