The fastest way: use "Encrypt with Password" in Excel
Open the file you want to protect. Go to File > Info > Protect Workbook > Encrypt with Password. Type your password twice and click OK. Save the file. The next time anyone opens it, they will see a password prompt before the spreadsheet appears.
This method encrypts the entire file, so someone cannot open it at all without the correct password. It works the same way in Excel for Windows and Excel for Mac. If you use Excel Online through Microsoft 365, this option is not available — you will need the desktop version.
Write your password down somewhere safe, separate from your computer. If you forget it, Microsoft cannot recover it for you, and the file becomes unreadable.
Key Takeaways
- Encrypting with a password locks the entire file so no one can open it without the correct password.
- You can also restrict editing only, which lets people view the file but prevents them from changing it without a password.
- Passwords cannot be recovered by Microsoft if you forget them, so store yours in a password manager or find location.
- Excel Online does not support password protection — you must use the desktop version of Excel.
- Restricting specific cells or sheets requires a different method than file-level encryption.
When to use "Restrict Editing" instead
If you want people to open and read the file but prevent them from changing it, use Restrict Editing instead of full encryption. Go to File > Info > Protect Workbook > Restrict Editing. Choose whether to allow changes to specific ranges or no changes at all, then set a password.
This approach is useful when you share a budget or template with others and want them to see the numbers but not alter formulas or structure. They can still copy data out of the file, but they cannot save changes back into it without the password.
The downside: if someone has a copy of your file and knows basic Excel tricks, they can sometimes work around these restrictions. Full encryption (the first method) is stronger.
Protecting individual sheets instead of the whole file
You can also lock just one sheet or a few sheets while leaving others editable. Right-click the sheet tab at the bottom of the screen and select Protect Sheet. Choose what you want to allow (editing cells, inserting rows, deleting columns, and so on), then set a password.
This is useful in a shared workbook where one sheet contains sensitive data and another contains information people need to update regularly. The person unprotecting the sheet will need your password, so this is not a security measure against determined attackers — it is more of a "please do not accidentally delete this" safeguard.
You can protect multiple sheets one at a time, but you cannot use the same password for all of them at once. If you protect five sheets, you will need to set a password for each one separately.
Protecting specific cells or ranges
If you want most of the sheet editable but certain cells locked, first select the cells you want to protect. Right-click and choose Format Cells > Protection tab, and check the Locked box. Then protect the sheet using the method above.
By default, all cells in an Excel sheet are marked as locked but the locking does not take effect until you protect the sheet itself. So the workflow is: mark which cells should be locked, then protect the sheet with a password. People can edit unlocked cells freely, but locked cells cannot be changed without unprotecting the sheet.
This approach works well for forms where you want people to fill in certain fields but not change headers, formulas, or instructions. It requires more setup than sheet protection alone, but gives you finer control.
What happens when someone tries to open a password-protected file
When a file is encrypted with a password, the person opening it sees a dialog box asking for the password before anything else loads. They type the password and click OK. If they enter the wrong password, Excel tells them it is incorrect and asks them to try again. There is no limit to how many times they can guess, so a weak password is still vulnerable.
If the file is restricted for editing only, it opens normally but shows a yellow banner at the top saying the file is protected. The person can read everything but cannot make changes. If they try to edit a cell, a dialog appears saying the sheet is protected and asking for the password to unprotect it.
For sheet-level protection, the same yellow banner appears, but only the protected sheet is locked. Other sheets in the same workbook remain fully editable.
Password strength matters more than you might think
A password like "123456" or "password" offers almost no real protection. Someone with the file and basic tools can crack it in seconds. If your spreadsheet contains financial data, personal information, or anything you would not want a coworker to see, use a password that is at least 12 characters long and includes uppercase letters, numbers, and symbols.
The best approach is to use a password manager like Bitwarden, 1Password, or KeePass to generate and store a strong password. Write down the master password to your password manager and keep it somewhere physical and find — a safe, a locked drawer, or a trusted person's house. Never email passwords or store them in a document on your computer.
If you are protecting a file that will be shared with others, tell them the password through a separate channel — a phone call, an in-person conversation, or a different email thread — not in the same message as the file itself.
Removing or changing a password later
To remove encryption from a file, open it with the password, go to File > Info > Protect Workbook > Encrypt with Password, and leave the password field blank. Click OK and save. The file is no longer encrypted.
To change the password, follow the same steps but enter a new password instead of leaving it blank. You will need to know the current password to make this change.
If you forgot the password and need to access the file, there is no built-in recovery method. Some third-party tools claim to crack Excel passwords, but they are unreliable and may contain malware. Your best option is to recreate the file from a backup or ask whoever set the password to reset it.
Frequently Asked Questions
Can I password protect an Excel file on my phone or tablet?
Excel for iOS and Android do not have a built-in password protection feature. You must use the desktop version of Excel (Windows or Mac) to encrypt a file. Once encrypted, you can open it on your phone, but you cannot remove or change the password from the mobile app.
Does password protecting an Excel file hide the data from my cloud storage provider?
Yes. When you encrypt a file with a password, the encryption happens on your computer before the file is uploaded. Your cloud provider (OneDrive, Google Drive, Dropbox) stores the encrypted file but cannot read its contents without the password. This is one of the strongest privacy protections available.
What if I share a password-protected file and the other person forgets the password?
They will not be able to open the file. There is no password reset or recovery option in Excel. You will need to open the file yourself, remove the password, and send them the unprotected version. Then you can set a new password if needed.
Can I protect an Excel file that is shared with multiple people?
Yes, but everyone who needs to open it must know the same password. If you want different people to have different access levels, you cannot do that with Excel's built-in protection. You would need to create separate versions of the file with different passwords, or use a more advanced tool like Microsoft 365's sensitivity labels.
Does password protecting a file slow down Excel?
No. Once the file is open, encryption has no effect on performance. The only slowdown is the few seconds it takes to decrypt the file when you first open it, which is usually unnoticeable on modern computers.