How to Hide Formulas in Excel (and Only Display the Value)

When you share a normal Excel file with others, they are able to see and edit everything that the Excel file has.

If you don’t want them to change anything, you have the option to either protect the entire worksheet/workbook or protect certain cells that have important data (that you don’t want the user to mess up).

But even when you protect the worksheet, the end-user can still click on a cell and see the formula that’s used for calculations.

If you want to hide the formula so that the users cannot see those, you can do that as well.

In this exact tutorial, I will show you how to hide formulas in Excel in a protected worksheet (so that’s it’s not visible to the user).

So let’s get started!

How to Hide All Formulas in Excel

When you have a formula in a cell, a user can see the formula in two ways:

  1. By double-clicking on the cells and getting into the edit mode
  2. By selecting the cell and seeing the formula in the formula bar

When you hide the formulas (as we’ll soon see how), the users won’t be able to edit the cell as well as not be able to see the formula in the formula bar.

Suppose you have a data set as shown below where you have the formula in column D.

Formula that you need to hide

Below are the steps to hide all the formulas in column D:

  1. Select the cells in column D that have the formula that you want to hideSelect the cells from which you want to hide the formulas
  2. Click the ‘Home’ tabClick the Home tab
  3. In the ‘Number’ group, click on the dialog box launcher (it’s the small tilted arrow icon at the bottom right of the group)Click on the dialog box launcher
  4. In the ‘Format Cells’ dialog box that opens up, click the ‘Protection’ tabClick on the Protection tab
  5. Check the Hidden optionCheck the hidden option
  6. Click OK
  7. Click the Review tab in the ribbonClick the Review tab
  8. In the Protect group, click on the Protect Sheet optionClick on Protect Sheet option
  9. In the Protection dialog box, enter the password that would be needed if you want to unlock the worksheet (in case you don’t want to apply a password, you can leave this blank)Enter the password in the Protect Sheet dialog box
  10. Click OK

The above steps would protect the entire worksheet in such a way that if you click on a cell that has a value you would see the value in the formula bar, but if you click on a cell that has a formula, no formula would be shown in the formula bar.

Formula hidden in the formula bar

And since the worksheet is protected, you would not be able to double-click on the cell and get into the edit mode (so the formula is hidden that way as well).

While this method works fine, you need to know that the sheets/cells that are protected in Excel can easily be unlocked by the user.

Any tech-savvy user can easily break into your protected workbooks (a simple Google search will give them multiple ways to break the protected worksheet). It’s not straight-forward, but it’s not too hard.

But if you’re working with less tech-savvy users, adding a password should be enough.

Also read: How to Lock Formulas in Excel

How to Only Hide Formulas in Excel (And Keep Rest of the Cells Editable)

In the above method, I showed you how to protect the entire worksheet (including the cells that have don’t have a formula in it).

But what if you don’t want to protect the entire worksheet? What if you only want to protect the cells that have formulas and hide these formulas from the user.

This could be the case when you want the users to input data (such as in a data entry form) but not be able to edit the formula or see it.

This can easily be done as well.

Unlike the previous method, where we protected all the cells in the worksheet, in this method we would only select the cells that have the formulas and protect these cells.

The remaining of the worksheet would remain open for the user to edit.

Suppose you have a data set as shown below where you only want to protect the formulas in column D (which has formulas).

Formula that you need to hide

For a cell to be protected, it needs to have the ‘Locked’ property enabled, as well as the protection enabled from the ribbon. Only when both of these happen does a cell truly becomes locked (i.e., can’t be edited).

This also means that if you disable the lock property for a few cells, these could still be edited after you protect the worksheet.

We will use this concept where we will disable the locked property for all the cells except the ones that have formulas in it.

Let’s see how to do this.

Step 1 – Disable the Lock Property for all the Cells

So, we first need to disable the Locked property for all the cells (so that these can’t be protected)

Below are the steps to do this:

  1. Select all the cells in the worksheet (you can do this by clicking on the gray triangle at the top left part of the sheet).Click on the gray triangle
  2. Click the Home tabClick the Home tab
  3. In the Number group, click on the dialog box launcherClick on the dialog box launcher
  4. In the Format cells dialog box, click on the ‘Protection’ tabClick on the Protection tab
  5. Uncheck the Locked optionUncheck the locked option
  6. Click Ok

The above steps have disabled the locked property for all the cells in the worksheet.

Now, even if I go and protect the sheet using the option in the ribbon (Review >> Protect Sheet), the cells would not be completely locked and you can still edit the cells.

Step 2 – Enable the Locked and Hidden Property only for Cells with Formulas

To hide the formula from all the cells in the worksheet, I now need to somehow identify the cells that have the formula and then lock these cells.

And while locking these cells, I would make sure that the formula is hidden from the formula bar as well.

Below are the steps to hide formulas:

  1. Select all the cells in the worksheet (you can do this by clicking on the gray triangle at the top left part of the sheet).
  2. Click the Home tab
  3. In the editing group, click on the Find & Select optionClick on Find and Select
  4. Click on the ‘Go-To Special’ option.Click on Go To Special
  5. In the Go To Special dialog box, click on the Formulas option. This will select all the cells that have a formula in itSelect the Formulas option
  6. With the cells with formulas selected, hold the Control key and then press the 1 key (or the Command key and the 1 key if using Mac). This will open the Number Format dialog box
  7. Click on the ‘Protection’ tab
  8. Make sure ‘Locked’ and ‘Hidden’ options are checkedCheck the Locked and Hidden option
  9. Click Ok
Also read: Highlight Cells With Formulas in Excel

Step 3 – Protecting the Worksheet

In the process so far, the Locked property is disabled for all the cells except the ones that have a formula in it.

So now, if I protect the entire worksheet, only those cells would be protected that have a formula (as you need the Locked property to be enabled to truly lock a cell).

Here are the steps to do this:

  1. Click the Review tabClick the Review tab
  2. In the Protect group, click on the ‘Protect Sheet’ optionClick on Protect Sheet option
  3. In the Protect Sheet dialog box, enter the password (optional)Enter the password in the Protect Sheet dialog box
  4. Click Ok

The above steps would lock only those cells that have a formula in it and at the same time hide the formula from the users.

The users won’t be able to double-click and get into the edit mode as well as see the formula in the formula bar.

Also read: Excel Formulas Not Working

How to Hide Formulas Without Protecting the Worksheet

If you’re wondering whether you can hide the formulas in Excel without protecting the sheet, unfortunately, you can’t.

While you can get this done by using a complex VBA code, it would be unreliable and can lead to other issues. Here is an article that shares such a code (use it if you really really can’t do without it)

As of now, the only way to hide the formulas in Excel is to protect the sheet and also make sure that the hidden properties enabled for the cells that have the formula.

I hope you found this tutorial useful.

You may also like the following Excel tutorials:

Excel Ebook Subscribe

FREE EXCEL BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Sumit Bansal
Hello there! I'm Sumit Bansal, founder of trumpexcel.com and an Excel MVP. I started this website in 2013 with a simple goal: to share my love for Excel through easy to follow tips, tutorials and videos. I'm here to help you get the best out of MS Excel to save time and boost your productivity.

Leave a Comment

Free-Excel-Tips-EBook-Sumit-Bansal-1.png

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free-Excel-Tips-EBook-Sumit-Bansal-1.png

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free Excel Tips EBook Sumit Bansal

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster