יום ראשון, 11 במאי 2014

Three Flavours of FACTorial in Excel

Three Flavours of FACTorial in Excel

What is a Factorial?

In mathematics, Factorial of a natural number n (denoted as n!) is the product of all natural numbers preceding (and including) n.
For example, if n=6,
then n! = 1*2*3*4*5*6=720

How to calculate Factorials in Excel?

There are (at least) three methods to calculate a Factorial in Excel:

1)    Using the built-in FACT function, with one argument: n

=FACT(6)
                    Picture No.1: =FACT(6)



2)    Using the PRODUCT function, with the numbers: 1,2,3,..n. The numbers can be entered one by one (not necessarily in their natural order) or by selecting a range which contains the array (i.e. A1:A6 which contains these numbers in any order: ascending, descending or unordered)

=PRODUCT(A1:A6) 
or
=PRODUCT(1,2,3,4,5,6)
or
=PRODUCT(6,5,4,3,2,1)

                             Picture No.2: =PRODUCT(A1:A6)


3)    Using the SUMPRODUCT function. This function usually takes at least 2 arrays (or ranges) and returns the sum of their products. But we’ll just enter the numbers, where each number is an array of 1 element: it’s as if we have 6 arrays (with one element in each array)…Here, too, the order of the elements doesn’t matter.

=SUMPRODUCT(1,2,3,4,5,6)
or
=SUMPRODUCT(6,4,5,2,3,1)



          Picture No.3: =SUMPRODUCT(1,2,3,4,5,6)        

          




אין תגובות:

פרסום תגובה