Excel - FORMULATEXT Function



FORMULATEXT Function

In large financial modelling, it is quite challenging to get deep insights into a complex formula in Excel. To demystify the complicated formula, you can get the tremendous advantage of the FORMULATEXT function, which is a part of the Lookup and Reference function in Excel.

The Excel FORMULATEXT function will retrieve a formula as a string. However, the FORMULATEXT function is not available in the older version of Excel and is exclusive to Excel 2013 and the later version.

Compatibility

This advanced Excel function is compatible with the following versions of MS Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel 2013

Syntax

The syntax of the FORMULATEXT function is as follows −

=FORMULATEXT(reference)

Arguments

You can use the following arguments with the FORMULATEXT function −

Argument Description Required / Optional
Reference It specifies a cell reference or cell range. Required

Points to Remember

  • If the cell reference specified in the Reference argument contains no formula then the FORMULATEXT function will return the #N/A error.
  • If the cell reference contains the formula larger than 8192 characters, then the FORMULATEXT function will retrieve the #N/A error.
  • This function works efficiently with the circular reference as the FORMULATEXT function will return the same formula in the text form.
  • If the Reference argument refers to another worksheet which is protected, then in this case, this function will return the #N/A error.
  • If the Reference argument points to the cell reference of another workbook which is unopened then in this case, the FORMULATEXT function will return the #N/A error.

Examples of FORMULATEXT Function in Excel

Practice the following examples to learn the use of the FORMULATEXT function in Excel.

Example 1: What does the FORMULATEXT Function do in Excel?

In this example, we will apply the FORMULATEXT function in the specific cell range to know the intricate formula.

Solution

Step 1 − Consider the sample dataset, which comprises two columns named Formula and Result. The list of independent formulas whose results are specified in the cell range B3:B6.

What does FORMULATEXT Function do in Excel1

Step 2 − After that, select the cell range C2:C8 and write the formula =FORMULATEXT(B2) in the formula bar.

What does FORMULATEXT Function do in Excel2

And then, press the "Ctrl+Enter" tab to populate the cell formulas.

What does FORMULATEXT Function do in Excel3

As you can observe in this example, using the FORMULATEXT() function, all formulas are displayed in the form of the text string. If the cell reference doesn't contain the formula, then in that case, the #N/A error will be retrieved by the FORMULATEXT function.

What does FORMULATEXT Function do in Excel4

Example 2: Combining with IFERROR function

In this example, we will cross check whether the cell reference contains formula or not. If it does not contain the formula encountering the error then the specific message is to be populated using the IFERROR function

Solution

Step 1 − First, select the C2 cell and enter the formula =IFERROR(FORMULATEXT(B2), "ERROR Found"). The IFERROR function verify whether the error occurred when evaluating the FORMUALTEXT function.

In this expression, first the FORMULATEXT(B2) formula is evaluated. If the formula exist in the B2 cell then the formula will be displayed as a text format. If formula not exist, then the "Error Found" message is displayed.

Combining with IFERROR function1

After that, hit the Enter tab.

Combining with IFERROR function2

Step 2 − Afterward, move to the next cell C3, double click on it and type the formula =IFERROR(FORMULATEXT(B3), "ERROR Found"). Here, the cell reference B3 points to the number 34.

Combining with IFERROR function3

And then, press the Enter tab.

Combining with IFERROR function4

Therefore, we can successfully handle errors when using the FORMUALTEXT function through merging IFERROR function.

Download Practice Sheet

You can download and use the sample data sheet to practice the FORMULATEXT function.

Advertisements