
Return the formula from a cell as text. FORMULATEXT is useful for audits, documentation, and checking whether formulas are consistent across a sheet.
The Excel FORMULATEXT function returns the formula in a referenced cell as text. Instead of showing the calculated result, it shows the actual formula string that Excel is using.
This is useful in audits, documentation, and model review. For example, a workbook can display its own formulas beside the outputs, or a checker sheet can test whether a formula contains a particular function name.
FORMULATEXT is not a calculation function in the usual sense. Its value is that it exposes formula logic so that the formula itself can be inspected.
Returns the literal formula from a referenced cell so it can be reviewed, displayed, or searched.
Returns the formula, including the leading = sign, as text.
=FORMULATEXT(reference)
reference is the cell that contains the formula you want to show. If the referenced cell does not contain a formula, FORMULATEXT returns #N/A.
Because the result is text, it can be combined with functions such as SEARCH, FIND, or exact comparisons to analyze the formula itself.
The referenced cell must actually contain a formula. If it contains a hard-coded number or text, FORMULATEXT does not return that value; it returns an error instead.
FORMULATEXT is best understood by comparing it with functions that answer different questions about a cell.
| Function | Main Question | Use When |
|---|---|---|
FORMULATEXT |
What formula is in this cell? | You want to display or inspect the formula itself |
ISFORMULA |
Does this cell contain a formula? | You only need a TRUE/FALSE answer |
CELL |
What property does this cell have? | You need information such as address, format, or filename |
Use FORMULATEXT when the exact formula matters. Use ISFORMULA when you only need to know whether a formula is present at all.
One common use of FORMULATEXT is self-documentation. A workbook can show both the result and the formula that produced it, which helps reviewers understand the model without entering each cell individually.
Another use is consistency checking. If two cells should contain the same logic pattern, their formula text can be compared directly. If one row was overwritten with a hard-coded value, FORMULATEXT can help reveal that difference.
It can also support simple formula scanning. Because the returned formula is text, a workbook can search for terms such as OFFSET, INDIRECT, or a particular sheet name.
#N/A if the referenced cell does not contain a formula.This formula shows the formula stored in B3 rather than the calculated result. That makes it useful in review sheets or documentation tables where the logic itself needs to be visible.
=FORMULATEXT(B3)
Retrieve the raw formula from cell B1. Formula: =FORMULATEXT(B1).
Displaying the formula from another cell can create live documentation inside the workbook. If the source formula changes later, the displayed formula text changes too.
=FORMULATEXT(B2)
Display the formula used in B2. Formula: =FORMULATEXT(B2).
Here FORMULATEXT is wrapped in SEARCH to check whether the formula contains the word OFFSET. This is a practical example of using formula text as data that can be analyzed.
=ISNUMBER(SEARCH("OFFSET", FORMULATEXT(B1)))
Show the formula stored in B10. Formula: =FORMULATEXT(B10).
Comparing two FORMULATEXT results shows whether the formulas are identical as text. This can help detect rows that no longer use the same logic pattern as the rest of the sheet.
=FORMULATEXT(A1)=FORMULATEXT(B1)
Extract the formula from B5. Formula: =FORMULATEXT(B5).
FORMULATEXT returns a cell's formula as text.=FORMULATEXT(reference).#N/A.Tell your friends about this post