Password protection locks your Excel file so that anyone who tries to open it must type the correct password first

Excel has a built-in password feature that prevents others from opening your spreadsheet without permission. When you set a password, the file stays encrypted — meaning the data inside is scrambled until someone enters the right password. This works on both Windows and Mac versions of Excel, and the process takes less than a minute.

The password you create is separate from your Microsoft account password. You can use any combination of letters, numbers, and symbols. Once you set it, you will need to remember it — Excel cannot recover a lost password, and there is no "forgot password" option for files.

Key Takeaways

  • Open your Excel file, go to File > Info > Protect Workbook, and select "Encrypt with Password" to add password protection.
  • Type your password twice to confirm it, then save the file — you will be prompted to enter the password every time you open it.
  • Password protection prevents others from opening the file at all, but does not prevent them from copying the file itself to another location.
  • If you forget the password, there is no built-in recovery method — write it down somewhere safe or use a password manager.
  • Protecting individual sheets (so people can view but not edit certain columns) is a different feature found under the Review tab.

Steps to add a password in Excel on Windows

Open the Excel file you want to protect. Click the File tab in the top left corner, then select Info from the menu on the left side. You will see a button labeled Protect Workbook — click the dropdown arrow next to it.

Select Encrypt with Password from the dropdown menu. A dialog box will appear asking you to enter a password. Type your password in the field — the characters will appear as dots for security. Click OK.

Excel will ask you to enter the password a second time to confirm you typed it correctly. Type it again exactly as you did the first time, then click OK. You will see a message confirming the password has been set. Now save your file using Ctrl + S or File > Save. The password is now active.

Steps to add a password in Excel on Mac

Open your Excel file and click File in the menu bar at the top. Select Info from the dropdown menu. Look for the button that says Protect Workbook and click the dropdown arrow next to it.

Choose Encrypt with Password. A dialog box will open asking for your password. Enter the password you want to use — it will show as dots as you type. Click OK.

Type the password again in the confirmation box to make sure you entered it correctly. Click OK, then save your file using Command + S. The password protection is now in place.

What happens when someone tries to open your protected file

When you or anyone else tries to open a password-protected Excel file, a dialog box appears immediately asking for the password. The file will not open until the correct password is entered. If the wrong password is typed, Excel simply says the password is incorrect and returns to the password prompt — there is no limit to how many times someone can try.

This means password protection is effective against casual access, but not against someone determined to break in using specialized tools. For highly sensitive financial or medical data, password protection is a good first step but should be combined with other security measures like storing the file in an encrypted folder or on a secure cloud service.

The difference between file passwords and sheet protection

Excel offers two separate protection features, and they do different things. A file password (what you just set up) prevents anyone from opening the file at all without the password. A sheet password is different — it lets people open and view the file, but prevents them from editing specific cells, deleting rows, or changing formulas.

Sheet protection is found under the Review tab at the top of Excel. If you want people to be able to see your data but not change it, use sheet protection instead. If you want to keep the file completely hidden from view, use the file password method described above.

How to change or remove a password

To change your password, open the file and enter the current password when prompted. Once the file is open, go to File > Info > Protect Workbook > Encrypt with Password. The password dialog will appear — leave the field blank and click OK twice. This removes the password.

Save the file. Now go back to File > Info > Protect Workbook > Encrypt with Password and enter your new password. Confirm it by typing it again, then save. Your file now has the new password instead of the old one.

Common mistakes that leave your file unprotected

The most common mistake is forgetting to save the file after setting the password. If you set a password but close Excel without saving, the protection will not take effect. Always press Ctrl + S (Windows) or Command + S (Mac) immediately after confirming your password.

Another mistake is confusing file passwords with sheet passwords. If you protect only the sheet (using the Review tab), people can still open the file and see all your data — they just cannot edit it. If you want the file itself to be locked, use the Encrypt with Password option under File > Info.

Finally, remember that password protection only prevents people from opening the file. It does not prevent someone from copying the file itself to a different location or sending it to someone else. If you need to prevent sharing, you will need to use file permissions through your cloud storage service (like OneDrive or SharePoint) instead.

Frequently Asked Questions

Can I open a password-protected Excel file on my phone or tablet?

Yes, if you have the Excel app installed on your phone or tablet, you can open password-protected files. When you try to open the file, you will be prompted to enter the password just as you would on a computer. The password works the same way across all devices.

What if I forget the password to my Excel file?

Excel does not have a password recovery feature for files. If you forget the password, you cannot open the file. To avoid this, write your password down in a secure location, use a password manager like Bitwarden or 1Password, or store it in a locked drawer. There is no way to bypass or reset a forgotten Excel file password.

Does password protection work if I save the file to OneDrive or Google Drive?

Yes, the password protection stays with the file no matter where you save it. Whether the file is on your computer, OneDrive, Google Drive, or Dropbox, anyone who tries to open it will need to enter the password. However, cloud storage services have their own permission settings — you can also restrict who can access the file through the cloud service itself.

Can someone open my password-protected file if they have my Microsoft account password?

No. Your Microsoft account password and your Excel file password are completely separate. Knowing your Microsoft account password does not let anyone open your password-protected Excel files. The file password is only for that specific file.

Is a password strong enough to protect sensitive financial data?

A password is a good basic protection, but for very sensitive information like tax records or bank statements, consider additional steps. Store the file in an encrypted folder, use a cloud service with two-factor verification, or keep the file on an external drive stored in a safe place. Password protection alone is effective against casual access but not against determined attempts to break in.