FORMULATEXT Function

Shows the formula in a cell as plain text.

Category

Lookup & Reference

Available in

Excel 2013+, Microsoft 365

Returns

The formula as text

Want to practice FORMULATEXT in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

FORMULATEXT displays the formula behind a cell, exactly as you'd see it in the formula bar. It's a great teaching and auditing tool.

If the referenced cell doesn't contain a formula, FORMULATEXT returns #N/A.

Syntax

=FORMULATEXT(reference) Explain

Arguments

ArgumentRequired?What it does
referenceYesThe cell whose formula you want to see.

Examples

Example 1 — Documenting a calculation

Show the formula next to its result.

D2fx=FORMULATEXT(C2)
ABCD
1QtyPriceTotalHow
242.5010.00=A2*B2
=FORMULATEXT(C2) Explain

Example 2 — Flagging hard-coded numbers

Check whether a cell holds a formula or a typed value.

=IF(ISFORMULA(C2), FORMULATEXT(C2), "Typed value!") Explain
Use FORMULATEXT in training sheets so learners can see the formula and result side by side.

Common mistakes

  • #N/A errors. The cell holds a value, not a formula. Wrap in IFNA or test with ISFORMULA first.

Notes

  • Formulas longer than 8,192 characters return #N/A.
  • Related functions: ISFORMULA, CELL.
Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.