Information
FORMULATEXT Function in Excel
Returns the formula in a cell as text.
Syntax
- =FORMULATEXT(reference)
Arguments
- reference (required): Cell containing a formula
Examples
- =FORMULATEXT(A1) - Get formula from A1 - Result: =SUM(B1:B10)
Excel FORMULATEXT function documentation
- FORMULATEXT returns the formula text from a cell as a string — audit and documentation tool.
- Syntax: =FORMULATEXT(reference). Shows what is actually in the formula bar.
- Use in formula inventories, change logs, and training workbooks.
- Related: [ISFORMULA](/functions/isformula/), [VALUE](/functions/value/), [CELL](/functions/cell/).
FORMULATEXT syntax and limits
- reference: must contain a formula — plain values return #N/A.
- Shows up to 8192 characters of formula text in modern Excel.
- Does not evaluate the formula — returns display string only.
- Useful beside result column: A=formula, B=result, C=FORMULATEXT(A).
Step-by-step: formula audit sheet
- Step 1 — List cell addresses in column A (e.g. Sheet1!D5).
- Step 2 — =FORMULATEXT(INDIRECT(A2)) if addresses as text.
- Step 3 — Flag non-formulas: =IF(ISFORMULA(INDIRECT(A2)), FORMULATEXT(...), "Value").
- Step 4 — Export audit tab before month-end close.
- Step 5 — Compare with [VALUETOTEXT](/functions/valuetotext/) for values not formulas.
FORMULATEXT vs showing precedents
- FORMULATEXT — text export for documentation.
- Trace Precedents — visual arrows UI.
- Name Manager — named formula inventory.
- Information category: [/categories/information/](/categories/information/).
Worked examples to copy
- Same sheet: =FORMULATEXT(D5).
- Other sheet: =FORMULATEXT(Summary!B10).
- With IF: =IF(ISFORMULA(E2), FORMULATEXT(E2), "Not a formula").
- Length check: =LEN(FORMULATEXT(E2)).
People also ask
- FORMULATEXT #N/A? — Cell has value not formula.
- FORMULATEXT array formulas? — Returns formula text of top-left cell in spill.
- FORMULATEXT Excel 2013? — Available Excel 2013+.
- Export all formulas? — Power Query or VBA for full workbook scan.
Common errors
- #N/A if cell doesn't contain a formula
Use cases
- Document formulas
- Audit spreadsheets
- Training materials
Frequently asked questions
- How do I show formulas next to their results? Put FORMULATEXT in an adjacent column: if A1 has =SUM(B1:B10), put =FORMULATEXT(A1) in C1 to display the formula text. Great for documentation and training spreadsheets.
- Why does FORMULATEXT return #N/A? FORMULATEXT returns #N/A when the referenced cell contains a value (not a formula), is empty, or references another workbook that's closed. Use IFERROR to handle: =IFERROR(FORMULATEXT(A1), "No formula").
- Can I use FORMULATEXT to copy formulas as text? Yes! FORMULATEXT extracts the formula as text, which you can then use with INDIRECT or copy elsewhere. However, INDIRECT won't evaluate the text as a formula - you'd need VBA or manual paste for that.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.
When to use FORMULATEXT
- Document formulas — common Information scenario for FORMULATEXT.
- Audit spreadsheets — common Information scenario for FORMULATEXT.
- Training materials — common Information scenario for FORMULATEXT.
FORMULATEXT in the Information category
- Browse all Information functions at /categories/information/ for related formulas.
- FORMULATEXT syntax: =FORMULATEXT(reference)
- reference (required): Cell containing a formula
- Confirm FORMULATEXT arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
Formula checklist before you copy down
- Confirm FORMULATEXT arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
- If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
- Spot-check three known input rows manually against expected output.
Related Excel functions
- ISFORMULA (/functions/isformula/): Returns TRUE if the cell contains a formula.
- CELL (/functions/cell/): Returns information about the formatting, location, or contents of a cell.
Errors to watch for
- #N/A if cell doesn't contain a formula — review causes on linked error pages in the directory.
Copy-paste audit workflow
- Enter FORMULATEXT on three test rows with known expected output documented on a QA tab.
- Fill down only after absolute references are locked on lookup tables and rate tables.
- Compare against manual calculation or a calculator for financial and statistical functions.
- Search this directory for comparison guides when choosing between similar functions in the same category.
FORMULATEXT worked examples to copy
- =FORMULATEXT(A1) — Get formula from A1. Expected result: =SUM(B1:B10).
FORMULATEXT reference summary for crawlers and offline review
- FORMULATEXT belongs to the Information category in Excel. Returns the formula in a cell as text.
- Full syntax: =FORMULATEXT(reference). Open /functions/formulatext/ for parameters, FAQs, and related pages.
- Common mistakes: #N/A if cell doesn't contain a formula
- Pair this function with comparison guides when another Excel formula might fit the same task better.
- Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.