FORMULA Function (OpenOffice Calc)
Read formula text with FORMULA in OpenOffice Calc, including numeric, text, logical, date and error-producing formulas, without evaluating a text string.
Verification status: Eight ordinary FORMULA examples were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using a generated three-sheet ODF workbook. Saved identities, typed results and both controls were checked. No manual-entry, XLSX-import or other-release execution is claimed. How formula examples are checked
Quick answer: =FORMULA(H5) produced "=SUM(1;2)" in the Apache OpenOffice 4.1.16 check below.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; no final supported release is established.
- Scope: English desktop Calc, semicolon-separated formulas and local workbook references.
- Checked: October 14, 2026. Eight examples were recalculated in 4.1.16 on Linux x86-64, Build9816. Generated-ODF identities, saved results and controls were checked; no manual-entry or different-release test is claimed.
What FORMULA returns
FORMULA returns the formula stored in a referenced formula cell as text, including its leading equals sign. It describes the calculation rather than returning that calculation’s value. The underlying formula may produce a number, text, a logical value, a date or an error. Release implementation.
Syntax and arguments
FORMULA(Reference)
Reference identifies the formula cell to inspect. Supply a single-cell reference for the examples here. A text string containing an expression is not evaluated by FORMULA.
Reproducible setup
On Reference, enter the supporting formulas in the setup table below. They deliberately have several different result types. H2 contains numeric 10, which H6 uses. The output formulas shown afterward inspect those exact cells.
| Cell | Enter this formula |
|---|---|
| H5 | =SUM(1;2) |
| H6 | =H2*2 |
| H7 | ="ready" |
| H8 | =IF(1;5;6) |
| H9 | =NA() |
| H10 | =2+3 |
| H11 | =TRUE() |
| H12 | =DATE(2025;1;1) |
Eight checked examples
All eight formulas were recalculated. Quotation marks identify text results; unquoted #N/A identifies an error. Logical tests in the explicitly number-formatted output cells are shown as 1/0. Reference expectations follow the inspected callback, workbook structure and ordinary arithmetic.
| Formula | Independent/source reference | Saved 4.1.16 result |
|---|---|---|
=FORMULA(H5) |
"=SUM(1;2)" |
"=SUM(1;2)" |
=FORMULA(H6) |
"=H2*2" |
"=H2*2" |
=FORMULA(H7) |
"=\"ready\"" |
"=\"ready\"" |
=FORMULA(H8) |
"=IF(1;5;6)" |
"=IF(1;5;6)" |
=FORMULA(H9) |
"=NA()" |
"=NA()" |
=FORMULA(H10) |
"=2+3" |
"=2+3" |
=FORMULA(H11) |
"=TRUE()" |
"=TRUE()" |
=FORMULA(H12) |
"=DATE(2025;1;1)" |
"=DATE(2025;1;1)" |
Practical worksheet
Put =H2*2 in H6 and =FORMULA(H6) in a separate cell. With H2 equal to 10, H6 calculates 20, while FORMULA returns the string "=H2*2". Changing H2 changes the calculated result without changing the formula text.
This is useful in a small calculation audit: keep the source value, calculated output and formula text visible in separate columns. It makes a replaced formula easier to notice, but it is not a proof that the formula is mathematically correct.
Advanced interpretation and checks
The tested error-producing H9 contains =NA(). =FORMULA(H9) still returns the text "=NA()" successfully. The function is retrieving the formula, not asking the referenced calculation to become an ordinary numeric result.
Likewise, the text-producing H7 returns ready as its value, but FORMULA returns the quoted expression ="ready". H12’s date formatting does not replace its formula: the returned text remains =DATE(2025;1;1) in the tested English setup.
For a column that mixes formulas and literals, a source-derived guard is =IF(ISFORMULA(A2);FORMULA(A2);"literal"). This avoids treating a literal as a formula cell. The guard was not a separate native example; its two relevant callbacks were inspected.
Boundaries and troubleshooting
The source sets an NA error when the resolved target is not a formula cell. A numeric literal, a blank cell and formula-looking text are not interchangeable with an actual formula. These unexecuted no-formula outcomes should not be confused with the successful error-formula retrieval in the table.
In the result table, backslashes inside quoted strings are presentation escapes. The actual H7 result is ="ready", with no backslash characters.
The returned representation can depend on the application’s formula syntax and language conventions. These exact strings are scoped to the English 4.1.16 execution. The guide does not establish byte-for-byte preservation of the user’s original keystrokes, alternate locale output or arbitrary range intersection behavior. FORMULA reads an expression; it does not provide an EVAL-style text-execution feature.
Related functions
Official evidence and checking scope
- Function-specific implementation
- Release function description and argument metadata
- English function identity
- Formula-cell test
The generated ODF was opened in the native GUI, hard-recalculated and saved separately. The informational “Not all attributes could be read” load warning was retained. A deliberately stale SUM cache refreshed to 3, and an uncached SUM returned 7. The exact local inputs, sheet order, formula identities and saved values were reconciled. The authoring-tool XLSX and its previews were not used as native calculation evidence. Only the listed cases and release are covered.