Hide or Lock Excel Formulas to Protect Them
Learn how to lock and hide Excel formulas so others can see results and enter inputs without changing the formulas underneath.
Shared spreadsheets break when someone types over a formula. A budget total gets replaced with a typed number, a lookup points to the wrong cell, or a row of calculations disappears after a careless paste. If you send a workbook to clients, coworkers, or students, you want them to see the results and fill in the input cells without changing how the numbers are calculated.
This guide shows how to lock formula cells, hide formulas from the formula bar, and protect the sheet so the changes stick. The method works in desktop spreadsheet apps that use .xlsx files, and the steps are general enough to follow in most of them. You will also learn what protection does not do, so you do not rely on it for more than it offers.
How do you lock and hide formulas in Excel? The short answer
Lock and hide the formula cells, leave the input cells free to edit, and then turn on sheet protection. Nothing is locked or hidden until the sheet is protected, so the last step is the one that makes the change work.
| Your situation | What to do | Why |
|---|---|---|
| People only need to enter numbers or text | Clear the Locked option on input cells and keep everything else locked | They can type where you expect and nowhere else |
| Formulas should stay visible | Lock the formula cells but leave the Hidden option off | Readers can still check how a total was built |
| Formulas should not be readable in the formula bar | Turn on Hidden for the formula cells, then protect the sheet | The formula bar shows nothing for those cells |
| You need to make changes later | Remove sheet protection, edit, then protect again | You keep control of the workbook |
| The file goes to people outside your team | Protect the sheet with a password you record, and send a test copy first | You can prove the setup works before sending it |
Before you start
Check these points before you change anything. They prevent a common problems.
- Save a backup copy. Protection changes the file, and a backup lets you undo a mistake. Name the copy so it is clearly the original.
- Decide which cells are inputs. Look for cells that hold typed numbers or text, such as a price, a quantity, or a date. Everything else is a candidate for locking.
- Check whether any formula refers to a cell you plan to lock. Locking does not stop a formula from reading a value, so this is not a problem by itself. It matters only if you later need to edit the referenced cell, which you can do after removing protection.
- Note how you will share the file. If you plan to send a PDF instead of the workbook, the PDF shows the values only. Protection does not carry into a PDF, so make the PDF from the protected workbook when you need a read-only copy.
- Decide on a password before you start. You can protect a sheet with no password, but then anyone can remove the protection in a few clicks. A password you keep somewhere safe gives you control, and a password you forget means you cannot edit the sheet either.
Locking and hiding formulas in Excel, step by step
- Select the input cells. Click the cells where people should type, or hold the Ctrl key (Command on a Mac) to pick several ranges. These cells will stay editable.
- Make the input cells editable. Open the cell format settings and clear the Locked option in the protection settings. Every cell is locked by default, so this step is what makes the inputs editable later.
- Select the formula cells. Pick the cells that contain calculations, such as totals, averages, or lookups. Leave the locked setting on for these cells.
- Hide the formulas. In the same cell format settings, turn on the Hidden option for the formula cells. This setting only affects what appears in the formula bar after the sheet is protected.
- Protect the sheet. Turn on sheet protection in your spreadsheet app. Choose what other people can still do, such as selecting cells, and leave the rest unchecked so they cannot change formats or insert rows.
- Set a password, or leave it blank. Enter a password if you want control over later edits. Write it down somewhere you can find it, because the app cannot recover it for you.
- Save the file as .xlsx. Protection and hidden formulas are saved with the workbook, so the next person who opens it sees the same setup.
- Test the result in a copy. Open the saved file, type in an input cell, and try to edit a formula. The next section lists exactly what to look for.
If you plan to translate the workbook with OmniDoc, which supports .xlsx files, do the translation first and protect the sheet afterward. Then open the translated file and confirm the formulas still point to the right cells before you send it.
Check the result
Open the protected file as a reader would, then run through these checks.
| Check | How to see it | If it's wrong |
|---|---|---|
| Input cells accept typing | Type a value into each input cell | If typing is blocked, go back and clear the Locked option for that cell, then protect the sheet again |
| Formula cells resist typing | Click a formula cell and try to type over it | If you can overwrite it, confirm the cell is still locked and the sheet is protected |
| Formulas are hidden | Click a formula cell and look at the formula bar | If the formula still shows, turn on Hidden for that cell and protect the sheet again |
| Results still update | Change a value in an input cell and watch the formula cells | If results do not change, check the formula references and whether calculation is set to manual |
| The password works | Remove protection with the password you chose | If it fails, use the password you recorded, or rebuild the protection on a new copy |
If something fails, fix one cell or setting at a time and retest. Protecting a sheet a second time overwrites the old setup, so keep the backup until the final test passes.
Limits of sheet protection
Sheet protection is meant to stop accidental edits by people who should not be changing formulas. It is not encryption. The formulas are still stored in the file, and a person with the right tools or enough determination can often get to them. If the logic in your workbook is confidential, do not rely on protection alone. Keep the sensitive version on your own machine, and send readers only the results or a separate copy.
Also keep in mind that protection applies to one sheet at a time. If your workbook has several sheets with formulas, protect each one.
❓ FAQ
1. Can someone still see a hidden formula?
Hiding keeps the formula out of the formula bar, but it does not encrypt the file. Treat it as a guard against accidental edits, not as a way to keep logic secret.
2. Do I need a password to protect the sheet?
No, but without one, anyone can remove the protection quickly. A password gives you control over later edits, and you must keep it safe because it cannot be recovered in the app.
3. Why can I still type in a cell I meant to lock?
The cell was probably still set as editable, or the sheet was not protected after you changed the setting. Lock the cell, then protect the sheet again, and test it.
4. Does protection survive when I convert the workbook to PDF?
A PDF shows the values as they appear, so there is nothing to edit in it. Protection itself is a setting of the workbook, so create the PDF from the protected file when you want a read-only copy.
5. Can I lock formulas in OmniDoc's own spreadsheet tool?
This guide covers the sheet protection in desktop spreadsheet apps. Check the help for the specific tool you use before you rely on protection there, because the steps may differ.
📝 Summary
To protect a shared file, make the input cells editable, lock and hide the formula cells, and then protect the sheet, because hidden formulas only take effect after protection. Test the file as a reader would, and remember that protection prevents accidental edits rather than securing the logic.


