The FACT function will return the factorial of any inputted number. A factorial is usually notated as any number with a trailing exclamation mark such as "4!".

## Contents:

## Syntax

`= FACT(`*number*)

*number *= the number you wish to calculate the factorial of

### Explanation

The FACT function is part of the "Math and Trigonometry" group of functions within Excel.

This function takes any *positive* input number, and calculates the factorial of the given number.

## What is a Factorial?

A factorial is notated as any number with a trailing exclamation mark "!", such as 2! or 59!.

This is a shorthand way of saying that a factorial is the product all positive integers from 1 to the *nth *number.

For example, 3! represents 1*2*3 = 6, while 4! represents 1*2*3*4 = 24, 5! would be 1*2*3*4*5 = 120, and so on.

The FACT function uses the below formula to calculate the factorial of any given number *n*:

*Notes:*

- If the input is not a number or contains any text elements, a #VALUE! error will be returned

- This function can only take the factorial of positive numbers. Any negative number will return a #NUM! error

- If the number is a decimal, then the FACT function will truncate the number. (6.45 becomes 6, 8.94 becomes 8, and so on)

### Examples

## How to Calculate the Factorial of any Number

To calculate the factorial of any given number, all you need to do is feed the number you wish to calculate into the FACT function. The FACT function will do the all of the math for you and return the correct result.

You can see in the example below that the FACT function will only work with positive integers. The negative values will return a #NUM! error, and all decimals will be cut off.

The input number can either be a hardcoded value, or a reference to another cell.

`= FACT(12)`

`= FACT(B1)`