close

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?

In B1, put formula =FACT(A1)

HTH,

--
AP

quot;Timquot; gt; a écrit dans le message de
news
gt; I want to take a number and then do a sum similiar to a factorial.
gt;
gt; Example:
gt;
gt; In cell A1 I input 5
gt;
gt; then in cell A2 the function adds 5 4 3 2 1
gt;
gt; if I put in 3 it adds 3 2 1
gt;
gt; is there a function that does this?
quot;Timquot; wrote:
gt; I want to take a number and then do a sum similiar to a factorial.
gt; Example:
gt; In cell A1 I input 5
gt; then in cell A2 the function adds 5 4 3 2 1
gt; if I put in 3 it adds 3 2 1
gt; 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

=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
Tim wrote:
gt;
gt; I want to take a number and then do a sum similiar to a factorial.
gt;
gt; Example:
gt;
gt; In cell A1 I input 5
gt;
gt; then in cell A2 the function adds 5 4 3 2 1
gt;
gt; if I put in 3 it adds 3 2 1
gt;
gt; is there a function that does this?

--

Dave Peterson

=SUMPRODUCT(--(ROW(INDIRECT(quot;1:quot;amp;A1))))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

quot;Timquot; gt; wrote in message
news
gt; I want to take a number and then do a sum similiar to a factorial.
gt;
gt; Example:
gt;
gt; In cell A1 I input 5
gt;
gt; then in cell A2 the function adds 5 4 3 2 1
gt;
gt; if I put in 3 it adds 3 2 1
gt;
gt; is there a function that does this?
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
--------------------
On Wed, 22 Feb 2006 12:21:03 -0600, Dave Peterson wrote:

gt; =a1*(a1 1)/2
gt;
gt; It's a neat formula that some kid figured out a long time ago...
gt;
gt; Say you want to add 1 2 3 4 5 6 ... 100
gt; Call that Sum S
gt;
gt; We can write it two ways:
gt; S = 1 2 3 ... 100
gt; S = 100 99 98 ... 1
gt;
gt; We add those two lines and we get:
gt;
gt; 2*S = 101 101 101 ... 101 (100 times)
gt; so
gt; 2*S = 100 * 101
gt;
gt; S = 100 * 101 / 2
gt;
gt; Replace that 100 with an arbitrary N:
gt;
gt; S = N*(N 1)/2
gt;
gt; Tim wrote:
gt;gt;
gt;gt; I want to take a number and then do a sum similiar to a factorial.
gt;gt;
gt;gt; Example:
gt;gt;
gt;gt; In cell A1 I input 5
gt;gt;
gt;gt; then in cell A2 the function adds 5 4 3 2 1
gt;gt;
gt;gt; if I put in 3 it adds 3 2 1
gt;gt;
gt;gt; is there a function that does this?

I think it was Carl Friedrich Gauss, actually.

Bill Martin wrote:
gt;
gt; The kid was Issac Newton. The story is that as punishment the teacher told
gt; the whole class to add up the numbers from 1 to 100. Newton stared at it a
gt; bit and just wrote down the answer. You can imagine the teacher's
gt; response.
gt;
gt; Bill
gt; --------------------
gt; On Wed, 22 Feb 2006 12:21:03 -0600, Dave Peterson wrote:
gt;
gt; gt; =a1*(a1 1)/2
gt; gt;
gt; gt; It's a neat formula that some kid figured out a long time ago...
gt; gt;
gt; gt; Say you want to add 1 2 3 4 5 6 ... 100
gt; gt; Call that Sum S
gt; gt;
gt; gt; We can write it two ways:
gt; gt; S = 1 2 3 ... 100
gt; gt; S = 100 99 98 ... 1
gt; gt;
gt; gt; We add those two lines and we get:
gt; gt;
gt; gt; 2*S = 101 101 101 ... 101 (100 times)
gt; gt; so
gt; gt; 2*S = 100 * 101
gt; gt;
gt; gt; S = 100 * 101 / 2
gt; gt;
gt; gt; Replace that 100 with an arbitrary N:
gt; gt;
gt; gt; S = N*(N 1)/2
gt; gt;
gt; gt; Tim wrote:
gt; gt;gt;
gt; gt;gt; I want to take a number and then do a sum similiar to a factorial.
gt; gt;gt;
gt; gt;gt; Example:
gt; gt;gt;
gt; gt;gt; In cell A1 I input 5
gt; gt;gt;
gt; gt;gt; then in cell A2 the function adds 5 4 3 2 1
gt; gt;gt;
gt; gt;gt; if I put in 3 it adds 3 2 1
gt; gt;gt;
gt; gt;gt; is there a function that does this?

--

Dave Peterson


www.newton.dep.anl.gov/askasc.../math99224.htm--
icestationzbra
------------------------------------------------------------------------
icestationzbra's Profile: www.excelforum.com/member.php...foamp;userid=4580
View this thread: www.excelforum.com/showthread...hreadid=515441Even though the link has Newton in its address, it still refers to Gauss lt;vbggt;.

icestationzbra wrote:
gt;
gt; www.newton.dep.anl.gov/askasc.../math99224.htm
gt;
gt; --
gt; icestationzbra
gt; ------------------------------------------------------------------------
gt; icestationzbra's Profile: www.excelforum.com/member.php...foamp;userid=4580
gt; View this thread: www.excelforum.com/showthread...hreadid=515441

--

Dave Peterson

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

Thanks.

Bill
-----------------------
On Wed, 22 Feb 2006 14:22:42 -0600, Dave Peterson wrote:

gt; I think it was Carl Friedrich Gauss, actually.
gt;
gt; Bill Martin wrote:
gt;gt;
gt;gt; The kid was Issac Newton. The story is that as punishment the teacher told
gt;gt; the whole class to add up the numbers from 1 to 100. Newton stared at it a
gt;gt; bit and just wrote down the answer. You can imagine the teacher's
gt;gt; response.
gt;gt;
gt;gt; Bill

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()