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:
- Prevent typing into specific cells: set cells to Locked and Protect Sheet.
- Hide formula logic: mark formulas as Hidden then Protect Sheet.
- Restrict who can edit particular ranges without unprotecting the sheet: use Allow Users to Edit Ranges.
- Stop adding, deleting, or renaming sheets: Protect Workbook (structure).
- Prevent opening or editing the file entirely without a password: see password protection options.
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.
- 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).
- 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.
- 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.
- 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:
- Select formula cells, Format Cells, Protection tab, check Hidden. Click OK.
- Ensure input cells are unlocked (uncheck Locked in Format Cells for those cells).
- Protect the sheet as described above. The formula cells will show results but their formula text will not show in the formula bar.
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.
- Go to Review - Allow Users to Edit Ranges. Create a new range and set a range password or assign Windows user accounts where supported.
- After defining ranges, protect the sheet. Users who match the range permissions can edit without unprotecting the sheet.
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.
- Unlock bonus input cells: select bonus cells, Format Cells - Protection - uncheck Locked.
- Lock salary cells and hide formulas if salary is calculated: select salary formula cells, check Locked and Hidden on Protection tab.
- Use Review - Allow Users to Edit Ranges to add the salary range and assign HR Windows accounts (or set a range password HR knows).
- 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
- Have you unlocked cells that must remain editable?
- Did you set Hidden on any formula cells you do not want revealed?
- Have you tested the sheet in the exact Excel environment your users will use (desktop, web, Mac)?
- Do you have a recovery plan or-record of passwords? Losing a sheet password can be difficult to recover.
- If sharing via OneDrive/SharePoint, did you set appropriate sharing permissions?
Common mistakes and how to avoid them
- Assuming Locked takes effect immediately: the Locked property does nothing until you Protect Sheet.
- Using a weak or forgotten password: keep a secure record; consider platform permissions instead of passwords for teams.
- Relying on sheet protection to secure sensitive data from inspection: protection deters editing and hides formulas, but it is not a substitute for encryption or controlling file access.
- Not testing with collaborators: different Excel versions and Excel Online can behave differently with protections.
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.