Lookup & reference function

FORMULATEXT function

Shows the formula in a cell as text, so you can display or document how a result was calculated.

Available in Excel 2013 and later, Microsoft 365, Excel for the web, Excel for Mac 2016+

Excel 2013 and laterWorks in Google Sheets

Syntax

FORMULATEXT(reference)
ArgumentWhat it means
referenceRequiredA cell (or range - only its top-left cell is used) that contains a formula. It can be on another sheet or in another open workbook.

Returns: The formula as text, starting with =, exactly as it appears in the formula bar.

How FORMULATEXT works

FORMULATEXT reveals the formula behind a cell without switching the whole sheet to formula view. Point it at a cell and it returns the formula as text - perfect for training material, audit sheets, or a column next to your calculations that shows readers how each number was produced.

The result is a snapshot of the formula bar: references appear exactly as typed and update if you insert rows, because Excel updates the original formula. If the target cell holds a typed value rather than a formula, FORMULATEXT returns #N/A, which makes it a quick test in combination with ISFORMULA or IFNA. It returns the text but never evaluates it.

Examples

1Show the formula behind a total

C5fx=FORMULATEXT(B5)
ABC
1MonthSales
2Jan8200
3Feb9150
4Mar10400
5Total27750=SUM(B2:B4)

Result: =SUM(B2:B4)

B5 contains =SUM(B2:B4) and displays 27750. FORMULATEXT returns the formula itself as text.

2A typed value has no formula

C2fx=IFNA(FORMULATEXT(B2), "typed value")
ABC
1MonthSales
2Jan8200typed value
3Feb9150
4Mar10400
5Total27750

Result: typed value

B2 is a typed number, so FORMULATEXT returns #N/A; IFNA replaces it with a label. This flags hard-coded numbers in a model.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe referenced cell has no formula, or it is in a closed workbook or a protected sheet whose formulas are hidden.Point to a formula cell, open the source workbook, or unprotect the sheet.

Tips

  • Ctrl+` (grave accent) toggles formula view for the whole sheet; FORMULATEXT is better when you want values and formulas side by side.
  • To document a whole column of calculations, put =FORMULATEXT(B2) next to the first one and copy it down.

Google Sheets

FORMULATEXT also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

FORMULATEXT in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishFORMELTEKST
DutchFORMULETEKST
FinnishKAAVA.TEKSTI
FrenchFORMULETEXTE
GermanFORMELTEXT
HungarianKÉPLETSZÖVEG
ItalianTESTO.FORMULA
Norwegian (Bokmål)FORMELTEKST
PolishFORMUŁA.TEKST
Portuguese (Brazil)FÓRMULATEXTO
Portuguese (Portugal)FÓRMULA.TEXTO
RussianФ.ТЕКСТ
SpanishFORMULATEXTO
SwedishFORMELTEXT
TurkishFORMÜLMETNİ

Recipes that use FORMULATEXT