How to Use the FACT Function in Google Sheets

Published on

The FACT is a math category function in Google Sheets. We can use it to find the factorial of a given number.

We can use factorial (denoted by n!) to find all the possible ways to arrange/order a set of distinct objects. In short, it’s for counting permutations.

For example, we can arrange the letters “X,” “Y,” and “Z” in 6 distinct ways.

It is as follows – “XYZ,” “XZY,” “YXZ,” “YZX,” “ZXY,” and “ZYX.”

The factorial is the product of a certain whole number (n) with all the numbers (non-negative integers) below it, i.e., <=n.

For example, let’s consider # 3.

3!= 3 x 2 x 1 = 6

We can easily find the factorial of an integer using the FACT function in Google Sheets. Here are the syntax and formula examples.

FACT Function in Google Sheets – Syntax and Argument

Syntax: FACT(value)

Value (parameter 1)- The non-negative number or cell reference for which you want to calculate and return the factorial.

Points to be Noted:

  • If the value is not an integer, it is truncated.
  • When the value is a reference, and it is blank, the function will add (zero) to it.
  • If the value is a text, the formula will return #VALUE!
  • When the input value is negative, the FACT function in Google Sheets will return #NUM!

Formula Examples

1. Non-negative number (Hardcoded):

=fact(3)

2. Non-negative number (Cell Reference):

Enter 3 in cell B2 and insert the below FACT formula in cell C2.

=fact(B2)

The FACT Function Array Formula Usage in Google Sheets

We can follow three methods to find the factorial of the numbers 1 to 10 in Google Sheets. Here are them.

Method 1 – Non-Array Formula:

Input the numbers 1 to 10 in an array, for example, in cell range A1:A10.

Use =fact(A1) in cell B1 and copy it. Paste it down until B10.

Method 2 – Array Formula:

Instead of the copy-paste formula, we can use the below FACT function Array Formula in cell B1.

=ArrayFormula(fact(A1:A10))
Examples to FACT Function in Google Sheets

Method 3 – Array Formula:

This time, we can use SEQUENCE to generate the numbers 1 to 10 within the formula.

=ArrayFormula(fact(sequence(10,1)))

Here the numbers in A1:A10 are not required. The SEQUENCE takes care of that numbers.

Reverse Factorial in Google Sheets

I don’t have any specific function to find and return reverse factorial in Google Sheets. But I do have a workaround method that you can try.

Please follow the below steps (except for the numbers 0 and 1).

  1. Enter any factorial in cell A3. For example, insert 3628800 in cell A3, which is the factorial of the number 10.
  2. Insert the following Vlookup in cell C3 =ifna(vlookup(1,{B3:B,sequence(rows(B3:B),1,2)},2,0)).
  3. In cell B3, enter =A3/2.
  4. In cell B4, enter =B3/row(A3). Copy-paste it down until you get the the number <=1.
Reverse Factorial Formula in Google Sheets

See cell C3 for the output.

That’s all about using the FACT function and finding reverse factorial in Google Sheets.

Thanks for the stay. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

More like this

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.