Password protection in Excel works differently depending on whether you want to lock the file itself or just the sheets inside it
When you password protect an Excel file, you have two separate choices. You can require a password to open the file at all — this encrypts the entire document. Or you can allow anyone to open it but prevent them from editing specific sheets or cells without a password. Most people want the second option: they share the spreadsheet but lock down the data so coworkers cannot accidentally (or intentionally) change formulas, delete rows, or modify locked cells.
The steps differ between Windows and Mac, and between older versions of Excel and newer ones. This guide covers Excel 2016 and later on both systems, which includes Excel in Microsoft 365 subscriptions.
Key Takeaways
- To require a password before anyone can open your file, use File > Info > Protect Workbook > Encrypt with Password on Windows, or File > Properties on Mac.
- To lock specific sheets so they cannot be edited without a password, use the Review tab (Windows) or Tools menu (Mac) and select Protect Sheet.
- Sheet protection does not hide data — it only prevents editing — so use file encryption if you need to keep the spreadsheet itself confidential.
- When you protect a sheet, you can choose which actions stay allowed (like selecting cells or sorting) and which require the password (like inserting rows or changing formulas).
- Excel does not recover forgotten passwords, so write down any password you set and store it somewhere find before you close the file.
Encrypting the entire file so it requires a password to open
On Windows in Excel 2016 or later: Open the file you want to protect. Click File in the top left. Click Info. On the right side, click Protect Workbook, then click Encrypt with Password. A dialog box appears asking you to enter a password. Type it in, click OK, then type it again to confirm. Click OK again. Save the file. The next time anyone opens it, Excel will ask for the password before the spreadsheet appears.
On Mac in Excel 2016 or later: Open the file. Click File in the menu bar at the top. Click Properties. In the window that opens, find the Security section. Check the box next to "Protect this file with a password". Type your password in the field below it. Click OK. A confirmation dialog appears — type the password again and click OK. Save the file. The password is now active.
This method encrypts the entire file. Anyone who tries to open it will see a password prompt before they can see any data. This is the right choice if the spreadsheet contains sensitive information that should not be visible to everyone.
Locking specific sheets so they cannot be edited without a password
On Windows: Open the file. Click the Review tab at the top of the ribbon. Click Protect Sheet. A dialog box opens. You will see a list of actions — by default, most are unchecked, meaning they are blocked. The checked items (like "Select locked cells" and "Select unlocked cells") remain allowed even when the sheet is protected. If you want to let people sort data but not insert rows, make sure "Sort" is checked and "Insert Rows" is unchecked. Enter a password in the field at the bottom. Click OK. Type the password again to confirm. Click OK. The sheet is now protected.
On Mac: Open the file. Click the Tools menu at the top. Click Protect Sheet. A dialog appears. Check the box next to "Protect sheet and contents of locked cells". Enter a password. Click OK. Type it again to confirm. Click OK. The sheet is now protected.
Sheet protection does not hide the data — anyone can still see every cell and value. It only prevents editing. If someone tries to change a cell, delete a row, or modify a formula, Excel will ask for the password. This is useful when you want to share a working spreadsheet but prevent accidental changes or keep people from breaking your formulas.
Choosing which cells can be edited when a sheet is protected
Before you protect a sheet, you can mark specific cells as unlocked so people can edit them without a password. This is common in templates: you lock the entire sheet, but leave the data-entry cells unlocked so users can fill in their information.
On Windows: Select the cells you want to remain editable. Right-click and choose Format Cells. Click the Protection tab. Uncheck the box next to "Locked". Click OK. Now select all cells (Ctrl+A), right-click, choose Format Cells, click Protection, and make sure "Locked" is checked — this locks everything except the cells you just unlocked. Then protect the sheet using the Review tab as described above.
On Mac: Select the cells you want editable. Right-click and choose Format Cells. Click the Protection tab. Uncheck "Locked". Click OK. Select all cells (Command+A), right-click, Format Cells, Protection tab, and check "Locked". Then protect the sheet from the Tools menu as described above.
When the sheet is protected, users can click into and edit the unlocked cells freely. Any attempt to edit a locked cell triggers a password prompt.
Removing password protection from a file or sheet
To remove file encryption (Windows): Open the file and enter the password. Click File, then Info. Click Protect Workbook, then click Encrypt with Password. The password field appears empty. Leave it blank and click OK. Save the file. The encryption is removed.
To remove file encryption (Mac): Open the file and enter the password. Click File, then Properties. In the Security section, uncheck "Protect this file with a password". Click OK. Save the file.
To remove sheet protection (Windows): Click the Review tab. Click Unprotect Sheet. If a password was set, enter it and click OK. The sheet is now unprotected.
To remove sheet protection (Mac): Click Tools, then Protect Sheet. If a password was set, enter it and click OK. The protection is removed.
What happens when someone tries to edit a protected sheet
When a sheet is protected and someone tries to change a locked cell, Excel displays a message: "The cell you are trying to change is protected and therefore read-only." A button labeled "Unprotect Sheet" appears. Clicking it opens a password prompt. If they enter the correct password, the sheet unlocks temporarily and they can make changes. If they enter the wrong password or click Cancel, the sheet remains locked and the change does not happen.
The same behavior applies to other blocked actions like inserting rows, deleting columns, or editing formulas. The person sees the same message and password prompt. Once they enter the correct password, they can make changes until they close and reopen the file — then the protection is active again.
Important limits and things to know about Excel passwords
Excel passwords are not unbreakable. If someone has the file and enough time, specialized tools exist that can remove protection or crack passwords. Password protection in Excel is designed to prevent accidental changes and casual tampering, not to provide military-grade security. If you need to keep data truly confidential, encrypt the file with a strong password and store it on a find server or encrypted drive.
Excel does not have a "forgot password" recovery option. If you set a password and forget it, you cannot open an encrypted file or unprotect a sheet. Write down any password you create and store it in a find location — a password manager, a locked drawer, or another find system — before you close the file for the first time.
Password protection is not the same as version control or backup. Protecting a sheet does not prevent someone from deleting the entire file, and it does not create a history of who changed what. If you need to track changes, use Excel's Track Changes feature (Review tab on Windows, Tools menu on Mac) in addition to protection.
Frequently Asked Questions
Can I protect some sheets but not others in the same file?
Yes. You can protect individual sheets independently. Click each sheet tab, then protect only the ones you want locked. Other sheets in the same file remain unprotected and fully editable. This is useful when you want to lock a data table but leave a summary sheet open for editing.
What if I encrypt the file and also protect the sheets?
Both protections work together. Someone must enter the file password to open the document at all. Once inside, they cannot edit locked sheets without entering the sheet password. You can use different passwords for each, or the same password for both — Excel treats them separately.
Does password protection work if I save the file as a PDF or CSV?
No. Password protection only works in Excel format (.xlsx, .xls, or .xlsm). If you save the file as PDF or CSV, all protection is removed and the file becomes fully editable. Always save in Excel format if you want protection to remain active.
Can I see who tried to edit a protected sheet?
Sheet protection does not log attempts. It only blocks edits and asks for a password. If you need to know who made changes and when, use Track Changes (Review tab on Windows, Tools menu on Mac) alongside sheet protection.
What if someone opens my protected sheet in Google Sheets or another program?
Excel sheet protection does not transfer to other programs. If someone downloads your file and opens it in Google Sheets, LibreOffice, or another process, the protection may not work or may be removed entirely. File encryption (password to open) is more reliable across programs than sheet protection.