Protect cells in Excel: lock cells, hide formulas, and control edits

Protect cells in Excel quickly: mark the cells you want to secure as Locked (and mark formulas as Hidden if needed), then enable Protect Sheet or Protect Workbook to enforce those settings. To let particular people change only certain ranges, use Allow Users to Edit Ranges or platform sharing permissions so they do not need to unprotect the whole sheet. Exact menu names and availability vary by Excel version and platform.

Which protection method do you need?

Decide what you want to stop: casual changes, exposure of formulas, structural edits, or unauthorized access to the file. Each goal uses a different feature:

Step-by-step: lock cells and enforce protection

The process has two phases: mark cells, then turn on protection. These are the exact actions you can follow in desktop Excel; Excel Online and Excel for Mac have similar options but menu labels and availability differ.

  1. Select the cells you want people to be able to edit. Right-click and choose Format Cells, or press Ctrl-1 (Cmd-1 on Mac).
  2. On the Protection tab uncheck Locked for those editable cells. Click OK. By default all cells are Locked, so this step unlocks the bits users should change.
  3. Select the cells you want to lock (the default is already locked) and, if you want to hide formulas from view, check Hidden on the Protection tab as well.
  4. On the Review tab choose Protect Sheet. Set the options you want (for example, allow sorting, allow formatting cells) and enter a password if you need one. Click OK. The sheet now enforces the Locked and Hidden attributes.

If you need users to edit only certain ranges without revealing the sheet password, see the section on Allow Users to Edit Ranges below.

Notes about Excel Online and Mac

Excel Online supports Protect Sheet but some granular features can be missing. Excel for Mac supports the same Locked/Hidden flags, but menu names may differ. If you do not see Protect Sheet, the workbook might be shared from OneDrive or protected at a higher level.

Hide formulas without blocking inputs

Hiding a formula keeps it from appearing in the formula bar; it does not prevent the result from updating. To hide formulas while letting users change input cells:

Allow specific people to edit ranges

If you want to let designated users edit certain cells without giving them the sheet password, use the Allow Users to Edit Ranges feature on Windows desktop Excel. This keeps the sheet protected while granting selective edit rights.

To learn more about the feature and its limits, refer to Allow edits without unprotecting.

Protecting workbook structure and file-level security

Protect Workbook (structure) prevents adding, deleting, hiding, or renaming worksheets. It is set on the Review tab and can be combined with sheet protection.

For full-file access control, use workbook-level password options or platform sharing permissions. Windows and macOS users can set an open or modify password in File - Info. For a dedicated guide on encrypting the file, see Password-protect Excel files.

Sharing while keeping protections

If the file is stored on OneDrive or SharePoint, you can preserve sheet protections and still share. Use the service's permission controls to grant view or edit access. When users edit in the cloud, their client must respect the workbook and sheet protections; behavior can vary between desktop and web editing.

For detailed guidance on sharing and securing in Microsoft cloud storage, see Share & secure files.

Worked example: secure a payroll column but let HR update it

Scenario: You manage a payroll sheet where only HR should change salary cells, but everyone can see results and some users should update bonus inputs.

  1. Unlock bonus input cells: select bonus cells, Format Cells - Protection - uncheck Locked.
  2. Lock salary cells and hide formulas if salary is calculated: select salary formula cells, check Locked and Hidden on Protection tab.
  3. Use Review - Allow Users to Edit Ranges to add the salary range and assign HR Windows accounts (or set a range password HR knows).
  4. Protect the sheet with a Protector password for administrators. HR can edit salary cells without unprotecting if their account or the range password is configured.

This combination keeps formulas private, prevents accidental edits, and reduces the need to share the sheet password.

Checklist before you enable protection

Common mistakes and how to avoid them

Closing: practical rules of thumb

Use Locked + Protect Sheet for cell-level edit control, add Hidden to keep formulas private, and apply Allow Users to Edit Ranges when selected people need exceptions. Reserve Protect Workbook for structural safeguards and use file-level passwords or cloud permissions to control access to the entire file. Test protections in the environment where users will work and keep a clear record of passwords and permission assignments.