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.

Finding Most Frequent Text in Excel with Dynamic Array Formulas

Looking to identify the most frequently occurring text in Excel? You can do this...

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

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.