Use Excel FORMULATEXT Function to get a formula from a cell as a text string. In simple words, when you refer to a cell which contains a formula, it will return that formula which is displayed in the formula bar if you select the referenced cell.
reference A cell reference from which you want formula as a text.
- You can refer to another workbook & another worksheet.
- If you refer to another workbook that workbook should be open, otherwise it will not show the formula.
- If you refer to a range more than a single cell, it will return formula from the upper left cell of the given range.
- It will return an “#N/A” error value if the cell you are using as a reference does not contain any formula, has a formula with more than 8192 characters, a cell is protected or an external workbook is not opened.
- If you refer two cells in circular reference it will return result from both.
Example to understand
In above example, I have tried to use formula text with a different type of references. When you refer to a cell which doesn’t have any formula, it will return “#N/A” error value.