Contact

FORMULATEXT in Google Sheets: Display and Audit Formulas

Lookup Intermediate Google Sheets

Inspect Google Sheets formula strings, compare expressions and build guarded formula listings with documented top-left and circular-reference handling.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =FORMULATEXT(B2) returns the formula in B2 as text. If B2 contains =SUM(A2:A4), the returned string is =SUM(A2:A4), not the sum calculated by that formula.

Availability and version history

  • Introduced: first introduction date is not established by the official history reviewed; no desktop release number is inferred.
  • Availability: documented in the rolling Google Sheets service; these examples use the web worksheet workflow.
  • Checked: October 14, 2026; official FORMULATEXT reference. Documentation and independent models, with no native Google Sheets execution or wider client certification.

Syntax and the documented reference

=FORMULATEXT(cell)

The argument identifies the cell containing the formula. Google describes the result as the formula-bar text. If a range is supplied, only its upper-left cell is evaluated; passing a range does not automatically produce a complete listing of all formulas in it.

The English strings shown below assume you enter the formulas as written. Exact displayed spelling or separators in another locale are separate reproduction details.

Example 1: show an expression next to its value

Put 9,16,28 in A2:A4. In B2 enter:

=SUM(A2:A4)

Its expected value is 53. In C2 enter =FORMULATEXT(B2), whose expected text is =SUM(A2:A4).

Change A4 to 30. B2 becomes 55, while C2 still displays the same expression. The inputs changed but the formula did not. Restore A4 to 28 for the remaining controls.

A formula-text panel can explain a calculation, but it does not preserve earlier inputs or record when someone edited the formula. It is a current inspection view rather than an audit history.

Example 2: distinguish equal results from equal text

In B3 enter =A2+A3+A4, also producing 53 on the restored numeric dataset. Compare:

=B2=B3
=EXACT(FORMULATEXT(B2),FORMULATEXT(B3))

Expected results are TRUE and FALSE. The two expressions currently calculate the same number but use different formula text.

A text comparison is not a symbolic proof that formulas are equivalent or different for every possible input. If later cells contain text or errors, a sum function and a chain of arithmetic operators need their own behavior review. Checking formula spelling and checking results answer different questions.

Example 3: list one source formula per row

Put =A2*3 in B4, with expected numeric result 27. Enter =FORMULATEXT(B2) in D2 and fill down through D4. Expected strings are:

  • =SUM(A2:A4)
  • =A2+A3+A4
  • =A2*3

By comparison, =FORMULATEXT(B2:B4) uses only B2 under the documented upper-left rule. The resulting text is =SUM(A2:A4), not three independently inspected cells.

Keep source and report columns distinct. If the report formula overwrites a source formula, the object being inspected has changed, regardless of whether the display still looks plausible.

Example 4: guard constants using ISFORMULA

On a separate part of the sheet, put numeric 53 in F2 and =SUM(A2:A4) in F3. Google’s ISFORMULA reference distinguishes whether a cell contains a formula. Use in G2 and fill to G3:

=IF(ISFORMULA(F2),FORMULATEXT(F2),"No formula")

Expected outputs are No formula and =SUM(A2:A4). This avoids depending on an undocumented assumption about what raw FORMULATEXT returns for a constant. It also asks the formula-existence question directly rather than interpreting every retrieval error as evidence of a constant.

The captured Sheets FORMULATEXT page does not specify the full no-formula, protection, external-file or length-limit error table. Those cases are not imported from Excel here.

Example 5: the documented reference-back pattern

Google explicitly says FORMULATEXT handles the case where the referenced cell points back to the cell containing FORMULATEXT. For a small reproduction of that pattern, set P2 to =Q2 and Q2 to:

=FORMULATEXT(P2)

The documentation-based expected text in Q2 is =Q2, the formula stored in P2. P2 in turn displays that same text. FORMULATEXT is inspecting the stored expression rather than recursively executing its value to obtain the text.

This specific documented handling is not permission to assume ordinary arithmetic cycles work. It does not certify every self-reference or iterative-calculation setting, and no native circular-reference experiment was performed for this guide.

TYPE classifies the calculated value, while EXACT compares text. Formula text can make a workbook more transparent, but an inspected expression still needs its ranges, inputs and expected outputs checked separately.

References and verification

Examples use fictional inputs, English function names and comma argument separators. Expected outputs are independently modeled from the cited rules, not native Sheets captures. Check the spreadsheet locale when reproducing punctuation-sensitive formulas.