Yes, Excel lets you password-protect a file so that anyone who opens it must enter the password first. You can also protect just the structure of a workbook (so users cannot add, move, or delete sheets) or lock specific cells and ranges so only you can edit them. This guide covers all three levels of protection, starting with the simplest: encrypting the whole file. Before you begin, make sure you have the file saved in a modern Excel format (.xlsx) — older .xls files work too, but the steps below are for the current versions of Excel for Windows and Mac. If you are using a different version, the exact wording of menus may differ slightly, but the logic is the same.

What You'll Need

  • A computer with Microsoft Excel installed (Office 365, Excel 2019, 2021, or 2024 for Windows or Mac).
  • The Excel file you want to protect, already saved on your computer.
  • A strong password that you can remember — Excel does not offer a password recovery option. If you forget it, the file may be unrecoverable.
  • Optional: a second password if you want to set a different one for modifying vs. opening the file.

Step-by-Step

Method 1: Password-Protect the Entire File (Encrypt)

  1. Open the Excel file you want to protect.
  2. Click on File in the top-left corner of the ribbon.
  3. In the left-hand menu, select Info (the first option, usually).
  4. Look for a section called Protect Workbook — it's a button with a shield icon. Click it.
  5. From the dropdown menu, choose Encrypt with Password. This is the option that requires a password to open the file.
  6. In the dialog box that appears, type your password. Excel will show dots as you type — there is no confirmation field here, so type carefully.
  7. Click OK. Excel will immediately ask you to re-enter the password to confirm. Type it again exactly the same way.
  8. Click OK again.
  9. Save the file (Ctrl+S on Windows, Cmd+S on Mac) to apply the password. From now on, anyone who opens the file will see a prompt asking for the password.

Note: This method encrypts the entire file. If someone guesses or obtains the password, they can see all the data and edit it. If you want to allow viewing but not editing, use Method 2 instead.

Method 2: Password-Protect the Workbook Structure (Prevent Adding/Deleting Sheets)

  1. Open the file.
  2. Go to the Review tab on the ribbon (it's between Data and View).
  3. In the Protect group, click Protect Workbook (not the File > Info one — this one is a small icon with a lock).
  4. A dialog box will appear. Check the box that says Structure. You can also check Windows if you want to prevent resizing or moving the window, but that's rarely needed.
  5. Type a password in the Password field (optional but recommended). If you leave it blank, anyone can unprotect it without a password.
  6. Click OK, re-enter the password, and click OK again.
  7. Now users can still open the file and edit cell contents, but they cannot insert, delete, rename, move, or hide sheets. To undo, go back to Review > Protect Workbook and enter the password to unprotect.

Method 3: Password-Protect Specific Cells or Ranges (Lock Only What You Choose)

By default, all cells in Excel are locked, but the lock only takes effect when you protect the worksheet. So to protect only certain cells, you first unlock the ones you want users to edit, then protect the sheet.

  1. Select the cells or ranges that you want users to be able to edit. For example, if you have a budget sheet and want users to enter their own numbers in column B, select column B.
  2. Right-click on the selected area and choose Format Cells (or press Ctrl+1 on Windows, Cmd+1 on Mac).
  3. Go to the Protection tab.
  4. Uncheck the box that says Locked. Click OK. This tells Excel: "These cells are not locked, so they can be edited even after protection."
  5. Now go to the Review tab and click Protect Sheet (not Protect Workbook).
  6. In the dialog box, enter a password (optional). You'll also see a list of actions that users can perform. The default list is fine for most cases — it allows selecting cells, but not editing locked ones.
  7. Click OK, re-enter the password, and click OK.
  8. Now, when a user tries to edit a locked cell, Excel will show a message saying the cell is protected. The unlocked cells (column B in this example) can be edited freely.

Tip: To protect only specific ranges with different passwords (e.g., allow one user to edit column A and another to edit column B), use Allow Edit Ranges on the Review tab. This lets you create separate ranges, each with its own password.

Common Mistakes

  • Forgetting the password — Excel has no built-in recovery. Write it down somewhere safe or use a password manager.
  • Confusing "Protect Workbook" with "Protect Sheet" — Protect Workbook (under File > Info) encrypts the file; Protect Workbook (under Review) only protects the structure. They are different features with similar names.
  • Not unlocking cells before protecting the sheet — If you forget to unlock the editable cells, the entire sheet becomes read-only, which is often not what you want.
  • Using a weak password — Passwords like "1234" or "password" are easily guessed. Use a mix of letters, numbers, and symbols.
  • Saving in the wrong format — If you save as CSV, the password protection is lost because CSV doesn't support encryption.
  • Sharing the password via unsecured channels — If you send the password in the same email as the file, it defeats the purpose.

Tips

  • Use a different password for opening vs. modifying. In the File > Save As dialog, click Tools (next to Save) and choose General Options. There you can set a "password to open" and a "password to modify." This is useful if you want to allow some users to view but not edit.
  • Always save the file after setting a password. If you close without saving, the password is not applied.
  • For sensitive data, consider using a strong password (at least 12 characters) and enabling two-factor authentication on your computer itself.
  • If you need to remove the password later, simply repeat the steps and delete the password from the field, then save.
  • Remember that password protection in Excel is not military-grade encryption. It's sufficient for casual protection, but for highly confidential data, consider using a dedicated encryption tool or a password-protected ZIP file.

Troubleshooting

If the password prompt does not appear when opening the file: First, make sure you saved the file after setting the password. If you did, try closing Excel completely and reopening the file. If it still opens without a prompt, go to File > Info > Protect Workbook and check if "Encrypt with Password" is highlighted. If not, the password was not applied — redo the steps.

If you forgot the password: Excel does not provide a way to recover it. There are third-party tools that claim to recover passwords, but they are often unreliable and may be flagged as malware. The only safe option is to restore from a backup or recreate the file. To avoid this, always store passwords in a password manager.

If you can open the file but cannot edit any cells: This likely means the sheet is protected. Go to Review > Unprotect Sheet and enter the password. If you don't know the password, you'll need to ask the person who protected it.

If you get an error saying "The password you typed is incorrect" when entering the password: Check that Caps Lock is off and that you're using the correct case. Passwords are case-sensitive. Also, if you set different passwords for open and modify, make sure you're entering the right one for the action you're trying to do.

If the file becomes corrupted after setting a password: This is rare but can happen if the file was saved while the password was being applied. Try opening the file in Excel's safe mode (hold Ctrl while opening). If that fails, restore from a recent backup.

Frequently Asked Questions

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

Yes. Use the Protect Sheet option on the Review tab. This protects the selected sheet only. Other sheets remain unprotected.

Can I set a password that allows viewing but not editing?

Yes. In the Save As dialog, click Tools > General Options and set a "password to modify." Users can open the file without a password, but they cannot save changes unless they enter the modify password.

Is Excel password protection secure enough for confidential data?

For most personal and business uses, yes. However, the encryption strength depends on the Excel version. Modern versions use AES-256, which is strong. But if you're dealing with highly sensitive data, consider using a dedicated encryption tool like BitLocker or Veracrypt.

Can I remove a password from an Excel file?

Yes. Open the file with the password, go to File > Info > Protect Workbook > Encrypt with Password, delete the password from the field, click OK, and save. For sheet protection, go to Review > Unprotect Sheet and enter the password, then save.

What happens if I forget the password to modify?

You can still open the file in read-only mode. But to edit and save, you need the modify password. If you forget it, you may be able to copy the content to a new file, but that could be time-consuming for large workbooks.

Does password protection work in Excel Online or Google Sheets?

Excel Online does not support password encryption. If you upload a password-protected file to OneDrive and open it in Excel Online, the password prompt will not appear — the file will open without protection. Google Sheets has its own sharing permissions but no password option. For online collaboration, use the sharing settings instead.