Show or Hide Formulas in Excel Using a Keyboard Shortcut, Button or Formula
by Avantix Learning Team | Updated March 7, 2022
Applies to: Microsoft® Excel® 2010, 2013, 2016, 2019, 2021 and 365 (Windows)
You can easily show or hide formulas in a number of ways in Microsoft Excel. You can use a keyboard shortcut, click a button and even use a formula to show formulas. Although you can double-click a cell or press F2 to show the formula in one cell, the first two methods will show formulas in all cells. With the third method, you can view formulas for specific cells.
Recommended article: How to Delete Blank Rows in Excel (5 Fast Ways to Remove Empty Rows)
Do you want to learn more about Excel? Check out our virtual classroom or live classroom Excel courses >
Showing formulas using a keyboard shortcut
You can show or hide formulas using a keyboard shortcut. Press Ctrl + tilde (~) or Ctrl + accent grave (`) to show or hide formulas. The tilde / accent grave key appears on the top left of most keyboards below the Esc key. This shortcut works in all versions of Excel.
Showing formulas using a button
An easy way to show or hide formulas in Excel is to use the Show Formulas button.
To show formulas using a button:
- Click the Formulas tab in the Ribbon.
- In the Formula Auditing group, click Show Formulas. The worksheet will now display with formulas instead of values.
- Click Show Formulas again to hide the formulas.
Below is the Formulas tab in the Ribbon:
Showing formulas using the FORMULATEXT function
You can also use the FORMULATEXT function in a cell to display the formula from another cell as a text string. This is very useful if you want to audit a worksheet and view both values and formulas. The FORMULATEXT function is available in Excel 2013 and later versions.
The syntax for the FORMULATEXT function is =FORMULATEXT(reference) where reference is a cell or a range of cells.
The FORMULATEXT function will return an #N/A error if:
- The formula refers to a cell that does not contain a formula.
- The formula refers to another workbook but the workbook is not open.
In the following example, we have regular formulas in column C and in column D, we've used the FORMULATEXT function:
So in D2, the formula would be =FORMULATEXT(C2).
Bonus: Hiding formulas and locking cells
There is one more method that you can use if you want to really hide formulas and prevent others from unhiding them. You'll need to choose the Hidden option in the Format Cells dialog box for specific cells and then protect the worksheet.
The first step is to hide the formulas:
- Select the cells with the formulas you wish to hide.
- Right-click the selected cell(s) and choose Format Cells or press Ctrl + 1. The Format Cells dialog appears.
- Click the Protection tab.
- Check Hidden. If you want to protect the cell(s) as well, ensure Locked is checked.
- Click OK. Nothing will appear to occur until you protect the sheet.
Below is the Format Cells dialog box:
The second step is to protect the worksheet:
- Display the worksheet with the cells that have been formatted as Hidden in the Format Cells dialog box.
- Click the Review tab in the Ribbon.
- In the Changes group, click Protect Sheet. A dialog box appears.
- Check or uncheck the desired options (you would usually leave the first two checked).
- Enter a password (you will need to set a password or anyone will be able to unprotect the sheet). Passwords are case sensitive and you should keep a copy of your passwords somewhere else.
- Enter the password again.
- Click OK. All formulas you have marked as Hidden will no longer appear in the Formula Bar.
Below is the Protect Sheet dialog box:
To unhide formulas and unprotect the worksheet:
- Display the desired worksheet.
- Click the Review tab in the Ribbon and click Unprotect Sheet.
- Enter the appropriate password.
- Click OK.
The first two methods are used most often but the last two provide some interesting alternatives.
Did you find this article helpful? If you would like to receive new articles, join our email list.
Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at firstname.lastname@example.org if you'd like to arrange custom instructor-led virtual classroom or onsite training on a date that's convenient for you.
Copyright 2023 Avantix® Learning
You may also like
It's easy to lock and protect cells in Microsoft Excel to prevent users from changing data or formulas. This involves a two-step process …
In Microsoft Excel, errors are flagged with small green marker or triangle in the upper left corner of the cell. However, these indicators display when there may be an error but is, in fact, not an error.
You can password protect worksheets and workbooks in Excel. If you want to prevent other users from opening or modifying an Excel workbook, you can encrypt the file with a password. You can also protect workbook structure where you can prevent users from deleting, renaming, moving or unhiding worksheets. Password protection can be added to your Excel file in several ways.
Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.
Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at email@example.com