Documentation/Calc Functions/FORMULA

Function name:
FORMULA

Category:
Information

Summary:
Displays the formula in a referenced cell as a text string.

Syntax:
FORMULA(Reference)

Returns:
Returns a text string which reflects the formula in the referenced cell. This string should be identical to that displayed in the Formula bar when the referenced cell is selected.

Arguments:
Reference is a reference to a cell containing a formula.


 * If the referenced cell is empty, or does not contain a formula, then FORMULA reports a #N/A error.
 * The FORMULA function does not propagate errors in the referenced cell. For example, if cell A1 contains the formula, then Calc reports an invalid argument error (Err:502) in cell A1. However, if cell A2 contains the formula   then cell A2 will display the string "=SQRT(-4)" rather than the error value.
 * FORMULA does not generate an error if given a reference to the cell that it resides in. For example, the formula  located in cell A7 simply returns the string "=FORMULA(A7)".

Additional details:

 * The FORMULA function is intended to aid understanding and debugging of spreadsheet documents by simplifying the display of formulas in other cells.
 * FORMULA can be used in an array formula by using the key combination Ctrl+Shift+Enter rather than just Enter.
 * FORMULA is a volatile function. This means that Calc will update the string returned by FORMULA when any cell is updated by selecting or pressing F9, or on any input event.

Related LibreOffice functions:
ISFORMULA

ODF standard:
Section 6.13.12, part 2

Equivalent Excel functions:
FORMULATEXT