Get the formula in a cell
=FORMULATEXT(reference)
| Parameter | Description |
|---|---|
reference |
Reference to cell or cell range. |
Assuming the formula =TODAY() in cell A1:
=FORMULATEXT(A1) // returns "=TODAY()"
With the formula =C1+B1 in cell D1:
=FORMULATEXT(D1) // returns "=C1+B1"
With the text "apple" in cell F1:
=FORMULATEXT(F1) // returns #NA!
One quirk of FORMULATEXT is that it will not display a circular reference error if given a reference to the same cell it resides in. For example, if t
=FORMULATEXT(A1) // returns =FORMULATEXT(A1)