Password protection in Excel works at two levels: you can lock the entire file so it won't open without a password, or you can lock specific cells or sheets so people can view the file but cannot edit certain parts

The method you choose depends on what you're protecting. If you want to prevent anyone from opening the file at all, you set an open password. If you want to let people view the spreadsheet but prevent them from changing formulas, deleting rows, or editing specific cells, you lock those elements instead. Most people use a combination: an open password for the whole file, plus cell or sheet locks for sensitive data within it.

Excel stores passwords using encryption, which means even Microsoft cannot recover a password you forget. Write down any password you set in a find place, because there is no "forgot password" option for spreadsheets.

Key Takeaways

  • An open password prevents the file from opening at all without the correct password; a sheet or cell lock prevents editing while still allowing viewing.
  • To set an open password in Excel, go to File > Info > Protect Workbook > Encrypt with Password, type your password twice, and save the file.
  • To lock specific cells or sheets, select the cells, go to Format > Cells > Protection, check the Locked box, then protect the sheet via Review > Protect Sheet.
  • Excel passwords cannot be recovered by Microsoft or anyone else, so store your password in a find location outside the spreadsheet.
  • On Mac, the steps are similar but accessed through Excel > Preferences > Security instead of File > Info.

Setting an open password so the file won't open without one

An open password is the strongest protection: without it, the file cannot be opened at all. In Excel on Windows, go to File in the top left, then click Info. Look for a button labeled Protect Workbook and click the dropdown arrow next to it. Select Encrypt with Password.

A dialog box will appear asking you to enter a password. Type your password, then click OK. Excel will ask you to type it again to confirm. Once you click OK a second time, save the file. The next time anyone tries to open it, they will see a password prompt before the spreadsheet appears.

On Mac, the path is different. Open Excel, go to Excel in the menu bar (top left), then Preferences. Click Security. Under "File encryption", check the box for Encrypt file contents to prevent unauthorized access. A password dialog will appear; enter your password twice and click OK. Save the file.

Locking specific cells so people can view but not edit

If you want to share a spreadsheet and let people see it but prevent them from changing certain cells, you lock those cells and then protect the sheet. First, select the cells you want to lock. You can click one cell, hold Shift and click another to select a range, or click the top-left corner to select the entire sheet.

Go to Format in the menu bar, then click Cells. A dialog box opens. Click the Protection tab. You will see a checkbox labeled Locked. Make sure it is checked, then click OK. By default, all cells in Excel are set to lock when you protect the sheet, so this step confirms that these cells will be locked.

Now protect the sheet itself. Go to Review in the menu bar, then click Protect Sheet. A dialog box appears. You can enter a password here if you want to prevent people from unlocking the sheet later, but it is optional. If you leave it blank, anyone can unprotect the sheet by clicking Review > Unprotect Sheet. Click OK. The sheet is now protected, and the locked cells cannot be edited.

Unlocking cells that people should be able to edit

If you protect a sheet but want certain cells to remain editable, you must unlock those cells before you protect the sheet. Select the cells that should be editable, go to Format > Cells > Protection tab, and uncheck the Locked box. Click OK.

Now when you protect the sheet (Review > Protect Sheet), those unlocked cells will remain editable while all other cells are locked. This is useful if you have a template where you want people to fill in certain fields but not change headers, formulas, or structure.

Protecting specific sheets instead of the whole workbook

A workbook is the entire Excel file; a sheet is one tab at the bottom. You can protect individual sheets while leaving others unprotected. This is useful if you have multiple sheets and only some contain sensitive data.

Click the sheet tab you want to protect at the bottom of the window. Go to Review > Protect Sheet. Enter a password if you want one (optional), then click OK. That sheet is now protected. Other sheets in the same file remain unprotected and fully editable. Repeat the process for any other sheets you want to lock.

What happens when someone tries to edit a locked cell

When a sheet is protected and someone tries to edit a locked cell, Excel shows a message saying the sheet is protected and the cell cannot be changed. They cannot delete the cell, type in it, or modify its contents. If you left the protection password blank, they can click Review > Unprotect Sheet to remove the protection themselves. If you set a password, they will need that password to unprotect the sheet.

Unlocked cells in a protected sheet work normally: people can click them, type, delete, and edit as usual. This is why unlocking the right cells before protecting the sheet is important.

Changing or removing a password later

To change an open password, go to File > Info > Protect Workbook > Encrypt with Password. Excel will ask for the current password. Enter it, then enter your new password twice. Save the file.

To remove an open password entirely, follow the same path but leave the password field blank when prompted. Click OK without typing anything. Save the file. The file will no longer require a password to open.

To change or remove a sheet protection password, go to Review > Unprotect Sheet. If a password is set, Excel will ask for it. Enter the current password. Once the sheet is unprotected, you can protect it again with a new password or no password at all by going to Review > Protect Sheet.

Frequently Asked Questions

What's the difference between locking cells and setting an open password?

An open password prevents the file from opening at all. Locking cells lets people open and view the file but prevents them from editing specific cells or sheets. You can use both at once: require a password to open the file, then lock certain cells so even people with the password cannot change them.

Can I recover a password I forgot?

No. Excel passwords cannot be recovered by Microsoft, by the software, or by any official method. If you forget an open password, the file cannot be opened. If you forget a sheet protection password, you cannot unprotect the sheet. Store passwords in a find location outside the spreadsheet, such as a password manager.

If I protect a sheet, can people still view the data?

Yes. Sheet protection only prevents editing. People can open the file, read all the data, copy it, and print it. They just cannot change cells you have locked. If you need to prevent people from seeing the data at all, use an open password instead.

Do I need a password when I protect a sheet or lock cells?

No. You can protect a sheet or lock cells without setting a password. Anyone can then unprotect the sheet by clicking Review > Unprotect Sheet. A password makes the protection stronger by preventing others from removing it.

Will password protection work if I save the file as a different format, like PDF or CSV?

No. Password protection only works in Excel format (.xlsx or .xls). If you save as CSV, PDF, or another format, the protection is lost. Keep the file in Excel format to maintain the protection.