Documentation/Calc Functions/FACT

    From The Document Foundation Wiki


    Function name:

    FACT

    Category:

    Mathematical

    Summary:

    Calculates the factorial of a non-negative integer (denoted by n!).

    Syntax:

    FACT(Number)

    Returns:

    Returns a positive integer that is the factorial of the given argument.

    Arguments:

    Number is a non-negative integer, or a reference to the cell containing that number, that is the value for which the factorial is to be calculated.

    • If Number is non-numeric, then FACT reports a #VALUE! error.
    • If Number is a non-integer value, then FACT converts it to an integer by taking its floor value.
    • If Number is less than 0, then FACT reports an invalid argument error (Err:502).
    • If Number is greater than 170, then FACT reports a #VALUE! error. (170! is a very large number, approximately 7.26 E+306)

    Additional details:

    • The formula for the factorial of a positive integer n is:

    [math]\displaystyle{ \text{FACT}(n)~=~n\times(n-1)\times(n-2)\times...\times\:1 }[/math]

    • FACT(0) and FACT(1) are both equal to 1.
    • For more information, visit Wikipedia’s Factorial page.

    Examples:

    Formula Description Returns
    =FACT(3.5) The floor value of 3.5 is 3 and 3! is equal to 3*2*1. 6
    =FACT(D1) where cell D1 contains the number 1. 1! is equal to 1. 1
    =FACT(0) 0! is defined to be 1. 1

    Related LibreOffice functions:

    FACTDOUBLE

    GAMMA

    ODF standard:

    Section 6.16.32, part 2

    Related (or similar) Excel functions:

    FACT