Excel has two password options: one to open the file, one to prevent editing

Excel lets you set a password in two separate ways. The first password stops anyone from opening the file at all — they see a dialog box and cannot proceed without the correct password. The second password lets people open the file but prevents them from making changes unless they enter the password. You can use one, both, or neither. Most people who password-protect a spreadsheet want the first kind: a password to open it.

Both options live in the same menu. On Windows, go to File > Info > Protect Workbook > Encrypt with Password. On Mac, go to File > Properties > Security > Encrypt File Contents. The steps are slightly different between versions, but the menu structure is the same.

Key Takeaways

  • A password to open the file prevents anyone without the password from seeing its contents at all.
  • A password to edit the file lets people view it but stops them from changing data unless they enter the password.
  • Excel stores passwords in a way that makes them very difficult to recover if you forget them, so write it down somewhere safe.
  • Password protection encrypts the file on disk, but does not protect it while it is open in Excel on your computer.
  • If you share the file by email or cloud storage, the password only protects it in transit and at rest — not while the other person has it open.

Setting a password to open the file (Windows)

Open the spreadsheet you want to protect. Click File in the top left, then click Info. On the right side, you will see a button labeled "Protect Workbook" with a dropdown arrow next to it. Click that arrow and select "Encrypt with Password."

A dialog box will appear with a single text field. Type your password and click OK. Excel will ask you to type it again to confirm. Once you click OK a second time, the file is encrypted. The next time anyone opens this file — including you — Excel will ask for the password before showing the spreadsheet.

If you forget this password, Excel cannot recover it for you. The file will remain locked. Write down your password and store it somewhere you can find it later, separate from the file itself.

Setting a password to open the file (Mac)

Open the spreadsheet. Click File in the menu bar at the top, then click Properties. A dialog box will open. Look for the Security section and check the box next to "Encrypt file contents." A password field will appear below it.

Type your password and click OK. Excel will ask you to type it again. Once confirmed, save the file — the encryption takes effect when you save. The next time the file opens, a password prompt will appear.

Like Windows, Mac has no password recovery. If you forget it, the file stays locked. Keep your password in a safe place outside the file.

Setting a password to edit (but not to open)

This option is less common but useful if you want people to see the spreadsheet without being able to change it. On Windows, go to File > Info > Protect Workbook > Protect Current Sheet. On Mac, go to Tools > Protect Sheet.

A dialog box will ask for a password. Type one and confirm it. Now anyone who opens the file can see all the data, but cells will be locked and formulas cannot be edited unless they enter the password. This is weaker protection than a password to open the file, because the data is still visible.

You can also protect the entire workbook (all sheets at once) instead of a single sheet. On Windows, use Protect Workbook > Protect Workbook Structure. The steps are similar.

What password protection actually covers

Excel password protection encrypts the file on your hard drive and during transmission. If you email a password-protected spreadsheet, it is encrypted in transit. If you upload it to cloud storage, it is encrypted at rest. Someone cannot intercept the file and read it without the password.

However, password protection does not protect the file while it is open on someone's computer. Once the password is entered and the file is unlocked, Excel holds the data in memory unencrypted. A person with access to the computer could potentially extract the data while the file is open. Password protection is a barrier to casual access, not a may provide against determined attackers with physical access to a machine.

Changing or removing a password

To change a password, open the file and enter the current password. Go back to File > Info > Protect Workbook > Encrypt with Password (Windows) or File > Properties > Security > Encrypt File Contents (Mac). Excel will ask for the old password, then let you set a new one. Save the file when done.

To remove the password entirely, follow the same steps but leave the password field blank when prompted. Click OK without typing anything. Save the file. The next time someone opens it, no password will be required.

Why password protection is not the same as sharing controls

Password protection is a single password for everyone. If you give the password to five people, all five have the same access. You cannot track who changed what, and you cannot revoke access to one person without changing the password for everyone else.

If you need to control who can see or edit a spreadsheet, and track changes by person, use your cloud storage's sharing settings instead. OneDrive, Google Drive, and Dropbox all let you set permissions per person and see edit history. Password protection is better for files you want to keep private from casual access, not for files you are actively collaborating on.

Frequently Asked Questions

Can I recover a password if I forget it?

No. Excel does not store passwords in a way that allows recovery. If you forget the password to open a file, the file is locked permanently. There is no official way to unlock it. Some third-party tools claim to crack Excel passwords, but they are unreliable and may introduce malware. The only safe option is to not use the file again.

Does password protection work if I share the file on OneDrive or Google Drive?

Yes, but only partially. The password protects the file while it is stored and in transit. Once someone downloads it or opens it in the cloud app, they need the password to see the contents. However, if you share the file link with someone, they still need the password — the link alone does not bypass it. For better control over who can access a file, use the cloud service's sharing permissions instead of Excel's password.

Can I password-protect just one sheet in a workbook?

Yes. Use Protect Sheet (Windows: Tools > Protect Sheet, Mac: Tools > Protect Sheet) to lock a single sheet while leaving others editable. This is useful if a workbook has multiple sheets and you only want to protect one. The password applies only to that sheet.

What happens if someone opens a password-protected file in an older version of Excel?

Older versions of Excel use weaker encryption. A file protected in a newer version may open in an older version, but the password protection might not work the same way. If you need to share with people using older Excel versions, test the file with their version first to make sure the protection works as expected.