
The Excel FORMULATEXT function returns a formula as a text string from given reference. You can use FORMULATEXT to extract a formula as text from a cell. If you use FORMULATEXT on a cell that doesn't contain a formula, you'll get an #N/A error.
Get the formula in a cell
The formula as text
=FORMULATEXT (reference)
You can use the FORMULATEXT function to extract a formula as text from a cell. Once extracted, you can work with the formula like any other text.
Remember that you can temporarily display all formula in a worksheet with a keyboard shortcut.
If you just want to test to see if a cell contains a formula or not, use the ISFORMULA function.
Notes:

The Excel FORMULATEXT function returns a formula as a text string from given reference. You can use FORMULATEXT to extract a formula as text from a cell. If you use FORMULATEXT on a cell that doesn't contain a formula, you'll get an #N/A error.
Get the formula in a cell
The formula as text
=FORMULATEXT (reference)
You can use the FORMULATEXT function to extract a formula as text from a cell. Once extracted, you can work with the formula like any other text.
Remember that you can temporarily display all formula in a worksheet with a keyboard shortcut.
If you just want to test to see if a cell contains a formula or not, use the ISFORMULA function.
Notes: