ONLYOFFICE FORMULATEXT Function: Display a Cell's Formula as Text
Use ONLYOFFICE FORMULATEXT to inspect calculations without changing them, including blank-looking results, errors, #N/A cases and array notes.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =FORMULATEXT(A2) is expected to display the formula typed in A2 as text, rather than the computed result. If A2 contains =2+3, the formula returns text resembling =2+3, not the number 5. Unlike a formula that calculates totals, FORMULATEXT is an audit and documentation tool. The ONLYOFFICE reference says it extracts the formula shown in the formula bar.
Availability and version history
- Introduced: Added in Desktop Editors 5.1.27 (May 23, 2018), according to the release history; introductions in other client families are unestablished.
- Availability: Documented in the current ONLYOFFICE Spreadsheet Editor help; no final working-version endpoint is established.
- Scope: Docs and Desktop Editors release separately. The unversioned function reference does not establish support in every older or mobile build.
- Checked: October 14, 2026, against the official FORMULATEXT reference. Documentation check; not a new native test.
Syntax, reference type and default
=FORMULATEXT(reference)
| Argument | Required? | Meaning | Default |
|---|---|---|---|
reference |
Yes | A reference to a cell or range whose formula text you want to inspect. | None documented. |
The argument is a reference, such as A2, not the value 5 calculated inside A2. FORMULATEXT yields a text representation of the formula, not a number you can safely use as a substitute for the original cell. An argument that points to a constant instead of a formula returns the #N/A error according to ONLYOFFICE’s help.
The official reference additionally documents range selection: for a range containing several formulas, the returned formula text is from the upper-left cell. It labels FORMULATEXT as an array formula, with further entry instructions in the vendor array-formula article. Use the single-cell output procedure below; a range argument does not automatically mean you want a spilled output range.
Copy-and-try worksheet: formula text versus displayed value
In a blank worksheet, enter the following exactly in A2:A7. Formula strings are deliberately small so readers can compare the formula bar with the text output. Enter =FORMULATEXT(A2) in B2 and fill down to B7.
| Cell | Enter in A | Expected A result | Formula in B | Expected B result |
|---|---|---|---|---|
| A2 | =2+3 |
5 |
=FORMULATEXT(A2) |
text =2+3 |
| A3 | =SUM(4,6) |
10 |
=FORMULATEXT(A3) |
text =SUM(4,6) |
| A4 | =IF(A2=5,"OK","Check") |
OK |
=FORMULATEXT(A4) |
text =IF(A2=5,"OK","Check") |
| A5 | Approved (literal text) |
Approved |
=FORMULATEXT(A5) |
#N/A |
| A6 | =NA() |
#N/A |
=FORMULATEXT(A6) |
text =NA() |
| A7 | =IF(A2=5,"","Mismatch") |
empty text | =FORMULATEXT(A7) |
text =IF(A2=5,"","Mismatch") |
Why these rows matter: A2 and A3 show that the calculation and the text of its formula are different. A4 illustrates that quoted strings and argument order are preserved in the formula text (subject to any normalization by the editor). A5 demonstrates that a constant has no formula to return. A6 demonstrates the opposite: a formula can return an error while its formula text remains retrievable. A7 looks blank but still contains a formula; it is not a genuinely empty cell. These results follow the vendor’s syntax and formula presence rule; character-for-character rendering after import, localization or auto-normalization requires a native check.
Enter only the data in the Enter in A column; the Expected A result and Expected B result columns are instructions, not cells to type. When copying the formula down, use relative references (A2 becomes A3, and so on).
Advanced audit: distinguish formulas from constants before extracting text
A single input column can mix formulas with text typed by users. To avoid displaying #N/A for every constant, use the independently documented ISFORMULA test:
=IF(ISFORMULA(A5),FORMULATEXT(A5),"Constant — no formula")
Put the formula in C5. Expected result for A5: Constant — no formula. Change the reference to A2 and the expected result becomes the text =2+3. This combines IF, ISFORMULA and FORMULATEXT to create a human-readable quality-assurance label. For a real audit, keep the calculated value in its own column, and put the formula text in a separate inspection column; do not overwrite the working formulas.
Alternative for an all-formula range: Vendor help documents that =FORMULATEXT(A2:A4) takes the upper-left formula when multiple formula cells are supplied. With this dataset, the documentation-described expected text is =2+3. Enter this range example in one empty cell using Enter. Do not select a multi-cell output unless that is the workflow you intend.
How array entry changes the workflow
The ONLYOFFICE array-formulas guide distinguishes pressing Enter for a single result from Ctrl+Shift+Enter for an intentionally selected multi-cell output array. Its examples illustrate formulas whose result spans multiple cells; it does not establish that every FORMULATEXT input should spill an array. Use the simple single-cell worksheets above first. The vendor describes braces around array formulas as generated by the editor—do not type braces manually.
Troubleshooting: results that look surprising
| Symptom | Reason to check | Practical response |
|---|---|---|
#N/A when referencing a cell with plain text or a constant |
The referenced cell does not contain a formula. | This is the vendor-documented result. Verify with =ISFORMULA(A5). |
#N/A appears when A6 itself contains =NA() |
Confusion between the error returned by A6 and the formula text in B6. | Check B6 rather than A6; vendor says a reference containing a formula has formula text. |
Cell displays 5 but FORMULATEXT shows =2+3 |
FORMULATEXT returns the expression, not the calculated number. | Reference A2 for arithmetic; use B2 for audits. |
| Expected text changes after copy/import | Formula names, separators or reference styles may be rewritten by the editor. | Compare the target cell’s current formula bar against the extracted string; record the editor version. |
| Trying a multi-cell range gives an unexpected arrangement | The function is labelled an array formula; entry shape/version matters. | Start with =FORMULATEXT(A2), read vendor’s array instructions, and test range behaviour separately. |
| A password-protected sheet or external workbook behaves unlike Excel | Specific Excel limitations are not established for ONLYOFFICE. | Do not assume the Microsoft error cases apply. Check target edition behaviour explicitly. |
English formulas and regional settings
The syntax in the English ONLYOFFICE help is FORMULATEXT(reference). Our example SUM(4,6) and IF(A2=5,"OK","Check") use comma-separated arguments as demonstrated in the vendor Insert Functions guide. A localized edition may display or accept different argument separators/function names; check the configured formula language and separator settings. Use the editor’s Formula tab → Function tool if copied examples produce a parse error.
Related guides
- ISFORMULA identifies cells containing formulas.
- IF chooses an audit label.
- SUM performs the calculation that the audit may document.
Example verification: Formula presence, literal expressions and simple arithmetic were checked independently against the cited ONLYOFFICE references. Exact formula-string normalization after import or localization was not native-tested.