Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula Protection: Lock Cells Without Locking the Sheet

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To protect formulas in Excel, unlock the input cells first, then lock the formula cells, then turn on sheet protection. The order matters: every cell is locked by default, but that lock only takes effect once you protect the sheet, so if you protect first without unlocking the input cells, nobody can type anywhere. The short version: select the cells users should be able to edit, press Ctrl+1 (Format Cells), clear the Locked checkbox on the Protection tab, then go to Review > Protect Sheet, set a password if you want one, and confirm that the formula cells are locked and the input cells are not. Menu labels can differ slightly by Excel version, platform and region, but the path is the same on Windows and Mac.

What You'll Need

  • Excel for Windows, Mac or the web (the web version has a reduced protection feature set; the desktop app is the reliable choice for this task)
  • A workbook with at least one formula you want to keep intact
  • A clear idea of which cells people should be allowed to type in (the inputs) and which should stay read-only (the formulas)
  • Optional: a password you are willing to store safely, because Excel cannot recover a forgotten sheet password

Step-by-Step

  1. Save a copy of the workbook first. Protection changes are easy to reverse, but a backup costs nothing and protects you from an accidental overwrite.
  2. Identify the input cells. Click each cell a user needs to fill in and note its address. Formula cells are the ones you want to stay locked; everything else that people type into must be unlocked.
  3. Select the input cells. Hold Ctrl (Cmd on Mac) and click each one, or drag across a contiguous range. If the inputs are scattered, select them one at a time.
  4. Open Format Cells. Press Ctrl+1 (Cmd+1 on Mac), or right-click the selection and choose Format Cells.
  5. Go to the Protection tab. Clear the Locked checkbox. Leave Hidden unchecked unless you also want to hide the formula from the formula bar. Click OK.
  6. Check the formula cells are still locked. Click a formula cell, open Format Cells > Protection and confirm Locked is ticked. It is by default, so you usually do not need to change anything here.
  7. Turn on sheet protection. Go to Review > Protect Sheet. In the dialog, leave Protect worksheet and contents of locked cells ticked.
  8. Choose what users may still do. The list of allowances includes selecting locked cells, selecting unlocked cells, formatting cells, inserting rows and sorting. For a form-style sheet, allow selecting unlocked cells and leave the rest off. Allowing formatting or inserting rows on a sheet with formulas can break references, so grant those only if you trust the users.
  9. Set a password if needed. Type it in the password box and confirm. Use a password only if other people must not remove the protection; if you are protecting against your own accidental edits, skip it. Store the password somewhere safe.
  10. Click OK. Try typing in an input cell (it should work) and in a formula cell (Excel should refuse with a message about protected cells).
  11. Protect the workbook structure if formulas live on hidden sheets. Review > Protect Workbook stops users from adding, deleting, renaming or hiding sheets, which is a common way formulas get broken indirectly.
  12. Test the file in the version your users have. Open it on the web or on a Mac if that is where it will be used, because protection behaviour and available options vary slightly between versions.

Common Mistakes

Protecting before unlocking inputs. This is the classic error. Every cell starts locked, so protecting the sheet first makes the whole sheet read-only. Unlock inputs first, then protect.

Assuming the Locked checkbox does anything on its own. It does not. Locking only takes effect when sheet protection is switched on, which is why people tick Locked and see no change.

Forgetting merged cells. If an input is part of a merged range, unlock the whole merged range, not just the top-left cell, or users will not be able to type.

Leaving Insert rows allowed on a formula sheet. Inserting rows can shift references and break formulas in ways the protection was meant to prevent. Allow only what users genuinely need.

Losing the password. Excel has no built-in recovery for a forgotten sheet password. If the password is only there to stop casual edits, leave it blank and protect without one.

Protecting the wrong sheet. Protection applies per sheet. If formulas are on a second tab, protect that tab too, or the user can simply edit there.

Tips

Use cell styles to mark inputs and formulas differently (for example a light fill on inputs) so users can see where they are allowed to type. Colour is not protection, but it reduces support questions.

Unlock whole input columns rather than individual cells when the form grows downward; new rows in an unlocked column inherit the unlocked state only if you copy the formatting, so check after adding rows.

Keep a separate unprotected master copy of the workbook. When you need to change a formula, edit the master, re-protect, and redistribute, rather than unprotecting the working file repeatedly.

If you need to hide formulas as well as lock them, tick Hidden on the Protection tab for those cells before protecting. The formula still calculates; it just does not show in the formula bar.

Sheet protection is not encryption. It stops accidental and casual edits, not a determined person with the right tools, so do not use it to guard sensitive data. Use workbook encryption (File > Info > Protect Workbook > Encrypt with Password) for that.

Troubleshooting

Users cannot type anywhere. The input cells are still locked. Unprotect the sheet (Review > Unprotect Sheet), unlock the inputs, then protect again.

Users can still edit a formula cell. Either that cell was unlocked, or the sheet is not protected, or the user has the password. Check Format Cells > Protection on the specific cell and confirm the sheet shows as protected.

The Protect Sheet button is greyed out. The workbook may be shared or the sheet may already be protected. Check Review > Unprotect Sheet and whether the file is open in a mode that limits changes.

Formulas return errors after protection. Protection does not change calculation. Look for a broken reference caused by a deleted or inserted row, or a formula that points at a sheet that was renamed.

You forgot the password. There is no official recovery. Restore from a backup or the unprotected master copy. Do not rely on third-party password-removal tools for files you did not create.

Protection behaves differently on the web. The browser version supports fewer protection options than the desktop app. Set protection up in the desktop app and open the file on the web to confirm it behaves as expected.

Frequently Asked Questions

Does locking a cell stop people from viewing the formula?

No. Locked cells still show their formula in the formula bar unless you also tick Hidden on the Protection tab before protecting the sheet.

Can someone bypass sheet protection?

Sheet protection deters casual and accidental edits; it is not a security boundary. For confidential data, use workbook encryption instead.

Why can users still change the formatting of locked cells?

Because the Protect Sheet dialog has a Format cells allowance that may be ticked. Untick it if formatting should be locked down too.

Do I need to protect every sheet?

Only the sheets whose contents you want to protect. Protection is per sheet, so a formula on an unprotected tab remains editable.

What happens to protection when I copy a sheet?

The copy carries the same protection state as the original. Check the new sheet and adjust the unlocked inputs if the copy serves a different purpose.

Can I protect a workbook without a password?

Yes. Leave the password box blank in the Protect Sheet dialog. Protection is applied, and anyone can remove it via Unprotect Sheet.