HomeGoogle DocsSpreadsheetHow to Use the FACT Function in Google Sheets

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.

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

More like this

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

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.