Yes. In Microsoft Excel for Microsoft 365 on Windows, you can encrypt a workbook with a password from File > Info > Protect Workbook > Encrypt with Password. Excel also lets you protect a worksheet or workbook structure, but those controls do not provide the same confidentiality as encrypting the file.
Three different kinds of Excel protection
The word “protect” covers several features in Excel, and choosing the right one matters. A password that prevents someone opening a file is fundamentally different from a setting that stops edits to certain cells. Excel’s Protect Workbook menu can make the distinction especially easy to miss.
- Encrypt with Password: Requires a password to open the workbook. The file’s contents are encrypted, so this is the relevant option when you need to keep the data unreadable to people who do not have the password.
- Protect Sheet: Restricts actions on a worksheet, such as editing locked cells. It is useful for preventing accidental changes to a template or report, not for hiding sensitive information from someone who can access the workbook.
- Protect Workbook: Protects the workbook’s structure, such as preventing users from adding, deleting, moving, hiding, or renaming sheets. It does not encrypt the workbook’s contents.
These protections can be used together. For example, a budget workbook might be encrypted to control who can open it, while its input sheet is protected to reduce accidental changes to formulas.
How to encrypt a workbook with a password
In Excel for Microsoft 365 on Windows, open the workbook and follow these steps:
- Select File, then Info.
- Select Protect Workbook, then Encrypt with Password.
- Enter a password, select OK, and enter it again to confirm.
- Save the workbook. Close it and reopen it if you want to check that Excel prompts for the password.
Excel passwords are case-sensitive, so uppercase and lowercase letters must match. This setting applies to the workbook file: someone who receives a copy of the encrypted file still needs the password to open it. It does not stop an authorized recipient from making an unprotected copy after opening the workbook, taking a screenshot, or sharing the password.
On current versions of Excel for Mac, password settings are generally available through File > Passwords; the wording and dialog can differ from Windows. Excel for the web does not provide the same controls for creating, changing, or removing workbook passwords. Use the desktop app when you need to manage file encryption, and check compatibility if people will open the file in other spreadsheet software.
Protect a worksheet from unwanted edits
To restrict changes to a sheet in the Windows desktop app, open that sheet and choose Review > Protect Sheet. You can enter a password or leave the password field blank, then select which actions users are allowed to perform, such as selecting cells, formatting cells, or sorting. Choose OK and confirm the password if you set one.
Worksheet protection works with cell settings. By default, cells are marked as locked, but that setting only takes effect after you protect the sheet. To leave designated entry cells editable, select them before protecting the sheet, open Format Cells (Ctrl+1 on Windows), go to the Protection tab, and clear Locked. Then protect the sheet. On Mac, Command+1 opens Format Cells in common Excel versions; menus and dialogs can vary slightly by release.
For example, a monthly report could have formula cells locked and shaded, while users enter figures only in unlocked cells. Protecting the sheet helps prevent someone from overwriting a formula while filling out the report. It should not be used to conceal payroll, customer, or other confidential information: worksheet protection is intended mainly to control editing, and it is not a substitute for file encryption or access permissions.
Protect the workbook structure
If you want to stop people changing the sheet layout, choose Review > Protect Workbook in Excel for Windows and select the structure protection option in the dialog. Set and confirm a password if appropriate. With structure protected, users cannot freely add, delete, move, hide, unhide, or rename worksheets. They can still view and edit cells if sheet-level settings allow it.
This feature is useful for a workbook with a fixed set of tabs, such as a reporting template where each department has a designated sheet. It does not prevent someone from reading the data, and it does not encrypt the file. Use the encryption command as well if the workbook itself must require a password to open.
Which protection should you choose?
Start by deciding what you are trying to prevent. A common mistake is to use sheet protection when the actual goal is to stop unauthorized people from seeing the workbook. Sheet protection does not meet that goal.
- Keep file contents private: Use Encrypt with Password, and share the password through a separate, trusted channel.
- Prevent accidental formula or layout changes: Unlock intended input cells, then use Protect Sheet with carefully chosen permissions.
- Keep tabs and their arrangement fixed: Use Protect Workbook for structure.
- Control who can access a shared business file: Consider OneDrive or SharePoint access permissions, which can be managed for particular accounts and changed later.
For a workbook containing sensitive information, layered controls may be appropriate: encrypt the file, limit access through the storage service, and protect formulas from accidental edits. Each control addresses a different risk, and none can prevent every kind of copying once a person has legitimate access to the data.
Password safety and recovery
Choose a long, unique password that is not reused for email, banking, or other accounts. A password manager can generate and store it securely. Avoid putting the password in the same email or message as the workbook; if both are forwarded or exposed together, the separate password provides little extra protection.
Keep a secure record of the password and make sure an appropriate colleague can access it if the file is needed during an absence. Excel does not offer a way to recover a forgotten encryption password, and Microsoft cannot retrieve it for you. For important files, maintain a properly secured backup and test that authorized people can open it. Do not assume that an old copy is a recovery method unless you know it contains the necessary data and is stored safely.
Also consider what happens after the workbook is opened. Password encryption protects the file while it is closed, but it cannot stop a recipient from copying data, photographing a screen, or sharing an unlocked copy. For highly sensitive work, access controls, organizational policy, and secure storage may be as important as the workbook password.
Changing or removing a password
To change or remove the password required to open a workbook, first open it with the existing password. In Windows, go to File > Info > Protect Workbook > Encrypt with Password. Replace the existing password to change it, or clear the password box to remove encryption, select OK, and save the file. Treat the unencrypted version as sensitive: anyone with access to that file can open it without the password.
To remove worksheet protection, go to Review > Unprotect Sheet and enter the sheet password if Excel requests it. Workbook-structure protection can be removed from Review > Protect Workbook by supplying its password. These passwords may be different from the password used to open the file, so keep track of which protection you applied.
Common problems and misconceptions
- The file opens without a password: You may have protected a sheet or workbook structure rather than encrypting the file. Close the workbook and check whether opening it prompts for a password.
- A cell cannot be edited: The sheet may be protected and the cell may still be marked as locked. Unprotect the sheet, adjust the cell’s Locked setting if you have permission, and apply protection again.
- Someone can still see protected data: Protect Sheet and Protect Workbook do not hide the contents. Use file encryption or suitable storage permissions for confidentiality.
- A password works in one place but not another: Check capitalization, keyboard layout, and whether you are entering the file password or a separate sheet password. Some web or third-party spreadsheet apps may handle Excel protection differently.
It is also worth distinguishing a password prompt from a read-only recommendation or a file marked as read-only. Those settings can discourage or limit editing in certain circumstances, but they are not equivalent to encryption and should not be treated as a secure way to keep a workbook private.
Frequently Asked Questions
Can I password protect an Excel file so nobody can open it?
Yes. Use File > Info > Protect Workbook > Encrypt with Password in Excel for Microsoft 365 on Windows, then save the workbook. Share the password securely with only the people who need it.
Is Protect Sheet secure enough for confidential information?
No. It is designed to limit editing, not to keep workbook contents confidential. Use password encryption to require a password to open the file, and use storage permissions when you need to control access to shared copies.
What happens if I forget my Excel encryption password?
Excel and Microsoft cannot recover the password for you. Check a password manager or another secure record, and look for an authorized backup. Without the password or an accessible backup, the encrypted workbook may be inaccessible.
Can I password protect Excel in a browser?
Excel for the web has fewer password-management capabilities than the desktop app and does not provide the same controls for adding, changing, or removing file encryption. Use Excel for Windows or Mac to manage the workbook password; behavior with an already protected file can depend on the protection and available web features.
Can I protect only some cells in Excel?
Yes. Unlock the cells users should edit through Format Cells > Protection, then protect the worksheet. Leave formula or heading cells locked. Sheet protection must be turned on for the Locked setting to restrict editing.
Related
- Master List Excel Template: Create, Organize, and Use It
- Master Contact List Excel Template: Build and Manage It
- Making a Schedule in Excel: A Practical Step-by-Step Guide
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Protect Excel Sheet Except Certain CellsTo protect an Excel sheet while leaving certain cells editable, select those cells, open Format Cells with Ctrl+1,…
- QGIS Copy Attribute Table to Excel: Steps & TipsYes. In QGIS, open the layer’s attribute table, select the rows you want, and use the table’s Copy…
- How to Create a Signature Line in OutlookTo create an email signature in Outlook, open the signature settings for your version of Outlook, add your…
- DDSolver Excel Add-in: What It Does and How to Use ItDDSolver is a specialized Excel add-in for analyzing and comparing in-vitro drug dissolution profiles; it is not the…
- Excel Insert Row Shortcut on macOS: Keys and OptionsIn Excel for Mac, select the row where the new row should go, then press Control+Shift+= (the plus…
- How to Open a Numbers File in Excel on a PCTo open a Numbers spreadsheet in Excel on a Windows PC, first convert the Apple .numbers file to…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.