You can control the display of formulas in the following ways:
Press CTRL + ` (grave accent).
Note: This procedure also prevents the cells that contain the formula from being edited.
Select the range of cells whose formulas you want to hide. You can also select nonadjacent ranges or the entire sheet.
Click Home > Format > Format Cells.
On the Protection tab, select the Hidden check box.
Click Review > Protect Sheet.
Make sure the Protect worksheet and contents of locked cells check box is selected, and then click OK.
Click the Review tab, and then click Unprotect Sheet. If the Unprotect Sheet button is unavailable, turn off the Shared Workbook feature first.
If you don't want the formulas hidden when the sheet is protected in the future, right-click the cells, and click Format Cells. On the Protection tab, clear the Hidden check box.
Hiding and protecting formulas is currently not supported in Excel Online.
If you have the Excel desktop application, click the Open in Excel button to open your workbook to hide and protect your formulas from being viewed or changed there.