In Excel: use =FORMULATEXT(reference) — it returns the formula in another cell as visible text, which is how you document a model inside itself.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
reference | required | The cell whose formula you want to display as text. |
Related functions
Select a cell in a documentation column beside your calculation block.
Type =FORMULATEXT( and click the cell whose formula you want to show.
Press Enter and fill down the block.
Wrap it in an ISFORMULA test so hard-coded constants are labelled rather than showing #N/A.
What this does
FORMULATEXT shows what formula a cell contains, as a string. It exists for auditing and documentation: a column beside a calculation block that displays each formula makes a model reviewable without clicking through every cell, and it stays correct when the formulas change. It returns #N/A when the referenced cell holds a constant rather than a formula, which pairs naturally with ISFORMULA as a guard. Requires Excel 2013 or later. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. For “use formulatext in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a workflow that saves repeating the same clicks every week useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
Documenting a model: =FORMULATEXT(C5) in a notes column returns the string "=B5*(1+$B$2)" for the reader to see. Guarding against constants: =IF(ISFORMULA(C5), FORMULATEXT(C5), "hard-coded"), which turns the same column into an audit flagging every typed-in number. FORMULATEXT makes a model self-documenting, which is the only kind of documentation that stays in step with the workbook. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “use formulatext in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Pointing it at a cell containing a constant, which returns
#N/A— that is information, but guard it withISFORMULAfor a tidy sheet. - Expecting it to evaluate the formula; it returns the text only.
- Using it in Excel 2010 or earlier, where it does not exist.
Frequently asked questions
How do I show a formula as text?
=FORMULATEXT(A1) returns the formula in A1 as a string. Ctrl+` toggles formula view for the whole sheet instead.
Why does FORMULATEXT return #N/A?
The referenced cell contains a value rather than a formula.
How do I audit hard-coded numbers?
Use =IF(ISFORMULA(C5), FORMULATEXT(C5), "hard-coded") down a column beside the model.