FORMULATEXT in Excel: Display and Compare Worksheet Formulas
Audit Excel formulas as text with reproducible comparisons, top-left range behavior and documented protection or closed-workbook limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =FORMULATEXT(B2) returns the formula stored in B2 as text, including its leading equals sign. It returns the formula’s spelling, not the calculated result and not a fresh execution of that text.
Availability and version history
- Introduced: the Microsoft function catalogue marks FORMULATEXT as an Excel 2013 addition; an exact first build or preview date is not established here.
- Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official FORMULATEXT reference. Documentation and independently modeled examples; no native Excel execution or broader platform certification.
Syntax and the returned text
=FORMULATEXT(reference)
The required reference identifies a cell or range. Microsoft describes the returned text as the formula shown in the formula bar for the referenced cell. For a multi-cell range, the documented selection is its upper-left cell; the function is not a complete range-to-formula listing in that single call.
Example 1: show a calculation beside its result
Put 12, 18, 25 in A2:A4. In B2 enter the formula exactly as shown:
=SUM(A2:A4)
Its numeric result is 55. In C2 enter =FORMULATEXT(B2). Expected text is =SUM(A2:A4), not 55.
Change A4 from 25 to 30. B2 becomes 60, while C2 continues to display the same formula text because the formula itself has not changed. Restore A4 to 25 before continuing.
This distinction makes FORMULATEXT useful for a worksheet explanation panel: readers can see the expression and its result side by side. It is not a record of prior values or a historical change log.
Example 2: same answer, different formula
In B3 enter:
=A2+A3+A4
The result is also 55. Compare:
=B2=B3
=EXACT(FORMULATEXT(B2),FORMULATEXT(B3))
Expected outputs are TRUE and FALSE. The first compares current results; the second compares the literal formula text. Equal results on one dataset do not prove formulas are interchangeable for all future inputs.
For example, the two expressions need not treat later text-valued inputs identically. This guide does not use a text comparison as a symbolic-algebra engine or as proof of business-rule correctness.
Example 3: list formulas one row at a time
In B4 enter =A2*2, whose result is 24. Put =FORMULATEXT(B2) in D2 and fill to D4. The three expected strings are:
- D2: =SUM(A2:A4)
- D3: =A2+A3+A4
- D4: =A2*2
By contrast, =FORMULATEXT(B2:B4) selects the formula in B2 under the documented upper-left rule. Do not expect that one range argument to certify a three-row list across all listed clients.
The exact strings assume the English formulas above were entered as written. A localized formula display, separators or other client-specific normalization can affect text comparison; those environments have not been natively exercised here.
Example 4: distinguish a constant from a formula
Put the constant number 55 in F2 and =SUM(A2:A4) in F3. Both display 55 on the restored dataset. =FORMULATEXT(F2) returns #N/A, whereas =FORMULATEXT(F3) returns =SUM(A2:A4).
For a readable display panel, use:
=IFNA(FORMULATEXT(F2),"Formula unavailable")
The deliberately broad fallback matters: #N/A can also mean that a formula is hidden by protection, is over the documented length boundary, or is in an external workbook that is closed. Do not label every #N/A as “constant cell.”
Documented limits and a self-reference control
Microsoft lists #N/A when there is no formula, the formula exceeds 8192 characters, protection prevents its display, or the external source workbook is not open. Invalid input types are documented as #VALUE!. These are retrieval restrictions, not permission to remove protection or open an unavailable workbook.
A special documented case is a reference to the formula’s own cell. If H2 contains =FORMULATEXT(H2), the expected text is =FORMULATEXT(H2); Microsoft says this use does not trigger a circular-reference warning. That specific exception does not make ordinary self-referential arithmetic safe.
Related checks
References and verification
The datasets are fictional. Expected results follow the cited rules and independent arithmetic or type models; they are not native application captures. Examples use English function names and comma argument separators.