Templates, guides & honest tool reviews for small business

Sunday, November 29, 2026

Lock Cells in Excel: Protect Formulas and Leave Input Cells Open

Lock Cells in Excel - explanatory illustration for lock cells in excel
Illustration: Lock Cells in Excel

Section: Excel & Google Sheets

To lock cells in Excel, select the cells, press Ctrl+1, open the Protection tab and tick Locked, then turn on Review, then Protect Sheet. The lock does nothing until the sheet is protected. By default every cell in Excel is already set to Locked, so the usual job is the reverse: unlock the cells people may type in, and then protect the sheet. This guide shows both, how to lock only formulas, how to use a password, and what to do if you forget it. The sample data is made up.

How locking works in Excel

Two settings work together. The first is the Locked property of each cell, which is on by default. The second is sheet protection, which is off by default. A cell is only really locked when its Locked property is on and the sheet is protected. That is why ticking Locked alone seems to do nothing.

How locking works - explanatory illustration for lock cells in excel
How locking works (explanatory illustration, not a software screenshot).

Lock all cells on a sheet

  1. Open the Review tab.
  2. Click Protect Sheet.
  3. Choose what users may still do, such as selecting cells.
  4. Type a password if you want one, and click OK.

If every cell still has its default Locked setting, this blocks direct edits to cell contents. Previously unlocked cells remain editable.

Lock only some cells

To leave input cells open, unlock them before you protect the sheet:

  1. Select the cells people should be able to edit, for example B2:D50.
  2. Press Ctrl+1 to open Format Cells and go to the Protection tab.
  3. Untick Locked and click OK.
  4. Go to Review, then Protect Sheet, and protect the sheet.

If all other cells still have their default Locked setting, B2:D50 remains editable and the other cells cannot be edited directly.

Unlock input cells (made up) - explanatory illustration for lock cells in excel
Unlock input cells (made up) (explanatory illustration, not a software screenshot).

Lock only the cells with formulas

Click the Select All button at the intersection of the row and column headings, open Format Cells and untick Locked. Then press Ctrl+G, click Special, choose Formulas and click OK. Excel selects every cell with a formula. Open Format Cells again, tick Locked, then protect the sheet. Direct edits to those formula cells are blocked; the other cells stay editable. Sheet protection is not a security boundary. This is useful for workbooks that use formulas such as those in our SUMIF guide.

Lock only formulas - explanatory illustration for lock cells in excel
Lock only formulas (explanatory illustration, not a software screenshot).

Choose what users can still do

The Protect Sheet box has a list of options. You can allow selecting locked cells, formatting columns, inserting rows, sorting and using filters. Keep only what people need. If you want users to sort a table, tick Sort, and make sure the cells in the sort range are unlocked, or the sort will fail.

Protect with a password

A password is optional. Without one, anyone can click Unprotect Sheet. With one, they need it. Write the password down in a safe place. Excel does not offer a normal way to recover a forgotten sheet password, and the protection is meant to prevent accidents, not to stop a determined person. Do not use it to secure private data. Use file encryption and sharing settings for that.

Let selected people edit a range

Under Review, Allow Edit Ranges lets you set a password for a range, so a user can edit it after entering that password. Set this before you protect the sheet. It is a light option and is not a user account system.

Unprotect a sheet

Go to Review and click Unprotect Sheet. Enter the password if there is one. Then you can change locks and edit freely.

Protect the workbook structure

Protect Sheet does not stop people from deleting or renaming sheets. For that, use Review, then Protect Workbook, which locks the structure of the file.

Combine with data validation

Locking controls which cells can be edited while sheet protection is on. Data validation controls what can be typed in the open cells. See our guide to the Excel drop-down list for a simple way to limit choices. In Google Sheets the same job is done with protected ranges.

Common problems

  • Nothing is locked. The sheet is not protected. Turn on Protect Sheet.
  • Cannot edit anything. You protected the sheet without unlocking the input cells.
  • Sort or filter fails. Sorting requires unlocked cells throughout the sort range. For filtering, apply AutoFilter before protection and allow Use AutoFilter; users can change an existing filter but cannot add or remove it while protected.
  • A macro fails on a protected sheet. The macro must be designed for the protection settings. Do not assume an ordinary edit macro can change protected cells.
  • Forgot the password. Keep a copy of the file before you protect it, and store the password safely.
Protection checks - explanatory illustration for lock cells in excel
Protection checks (explanatory illustration, not a software screenshot).

Questions and answers

Why does Locked not stop editing?

Locking works only after Protect Sheet is on.

What is the shortcut for Format Cells?

Press Ctrl+1.

Can I lock cells in Excel for the web?

Excel for the web has Review, then Manage Protection. Turn on Protect sheet and configure unlocked ranges there. The desktop Ctrl+1 steps above describe Excel for Windows.

Does locking hide formulas?

No. Locking stops edits only. Formulas can be hidden with the Hidden option on the Protection tab, which works after the sheet is protected.

Official references

العربية