How to password protect an Excel file

Key takeaways

  • On Windows, use File, Info, Protect Workbook, Encrypt with Password, confirm the password, save, then reopen the file to confirm Excel asks for it.
  • Excel for Mac uses File, Passwords with a 15-character limit, and Excel for the web cannot add, change or remove workbook passwords.
  • File encryption controls opening, workbook protection controls sheet structure, and worksheet protection only prevents changes to locked cells, so it is not a security feature.
  • Microsoft cannot retrieve forgotten Excel passwords, so store the password in a manager and share it separately from the attachment.

To password protect an Excel file so people cannot open it without permission, use Excel’s file-level password protection—not just worksheet protection. On Windows, choose File > Info > Protect Workbook > Encrypt with Password, enter and confirm your password, then save. This article covers Windows, Mac, browser limitations, and choosing the right protection for your spreadsheet. (support.microsoft.com)

How do you password protect an Excel file on Windows?

In the Excel desktop application for Windows, open your workbook and use Encrypt with Password under the File menu. This applies file-level protection, requiring a password before someone can open the workbook and access its contents. Microsoft documents this option for Excel for Microsoft 365 and supported standalone desktop versions. (support.microsoft.com)

Follow these steps:

  1. Open the Excel file you want to protect.
  2. Select File, then Info.
  3. Select Protect Workbook.
  4. Choose Encrypt with Password.
  5. Enter your chosen password and select OK.
  6. Enter the same password again, then select OK. Passwords are case-sensitive. (support.microsoft.com)
  7. Save the workbook to retain the protection setting. (cag.gov.in)

As a final check, close the workbook and reopen the saved file. Confirm that Excel asks for the password before displaying your data. Test the exact copy you intend to share, rather than relying on the settings of another version.

How can I password protect an Excel file on a Mac?

In Excel for Mac, use File > Passwords and enter a password in the Password to open field. Confirm the password and save the workbook. This is the option to choose when you want to prevent someone from opening the file, rather than simply restricting changes. (learn.microsoft.com)

The process is straightforward:

  1. Open the workbook in Excel for Mac.
  2. Select File > Passwords from the menu.
  3. Enter your password under Password to open.
  4. Select OK and reenter the password when prompted.
  5. Confirm the entry, then save your file. (learn.microsoft.com)

Microsoft’s Mac guidance notes a 15-character password limit and warns that longer passwords created in Windows can prevent a workbook from opening on Mac. If you share between platforms, check compatibility before sending the file. Test with the recipient’s Excel version rather than assuming the experience will be identical. (support.microsoft.com)

Can you password protect an Excel file online?

Excel for the web does not let you add, change, remove, or recover workbook passwords. To set a password, open the workbook in the desktop Excel application using Open in Excel, apply protection there, and save. Do not confuse browser-based worksheet controls with a password required to open the file. (support.microsoft.com)

Microsoft’s browser guidance says password-encrypted workbooks can be opened and edited in Excel for the web, although its workbook-protection page includes additional editing caveats. For password management or an unsupported browser workflow, use desktop Excel. (support.microsoft.com)

Before adopting this approach for a shared team workbook, test opening and editing in the apps your colleagues use. If you cannot find the encryption command, first check whether you are working in a browser rather than the desktop application.

Choose file encryption, workbook protection, or sheet protection

Excel uses similar names for features that solve different problems. File encryption controls opening, workbook protection controls sheet structure, and worksheet protection controls changes within a sheet. You can combine these protections when your workbook needs more than one kind of restriction. (support.microsoft.com)

Your goal Appropriate protection Practical use
Require a password before viewing data File-level encryption Limit access to a private workbook
Prevent adding, deleting, moving, or renaming sheets Workbook-structure protection Preserve a multi-sheet template
Restrict changes to selected cells Worksheet protection Keep formulas intact while allowing data entry
Provide different opening and modifying permissions Password-to-open and password-to-modify options Separate viewing from editing access

These are distinct protection levels in Microsoft’s Excel documentation. A password that restricts modification should not be treated as a substitute for an opening password when confidentiality matters. (support.microsoft.com)

For example, a household budget might need an opening password to keep its contents private. A team expense template might instead need editable input cells and protected formulas. A sensitive team workbook could need both: file encryption for access and sheet protection for its working layout.

The important distinction is privacy versus editing control. Microsoft explicitly warns that worksheet protection is not a security feature; its purpose is to prevent changes to locked cells. (support.microsoft.com)

Protect formulas while leaving input cells editable

If your aim is to password protect Excel formulas from unwanted edits, protect the worksheet after unlocking the cells people should use. This lets you build a practical template without preventing every change. The unlocking step matters because locked cells become restricted when sheet protection is enabled. (support.microsoft.com)

In desktop Excel:

  1. Select the cells that users should be allowed to edit.
  2. Right-click and choose Format Cells.
  3. Open the Protection tab and clear Locked.
  4. Select OK.
  5. Go to Review > Protect Sheet.
  6. Choose the actions users may perform, such as selecting unlocked cells.
  7. Enter a password if you want to require one to unprotect the sheet, then confirm it. (support.microsoft.com)

For an expense form, try leaving date, description, and amount fields editable while protecting calculated totals. Test the finished template by entering a sample expense and attempting to change a formula. This checks whether the restrictions match the actual task.

Change or remove an existing password

On Windows, open the workbook with its current password, then return to File > Info > Protect Workbook > Encrypt with Password. Replace the existing password to change it, or clear the password box to remove it. Confirm and save the workbook afterward. (cag.gov.in)

On Mac, open the workbook and select File > Passwords. Change or delete the relevant entry, confirm as required, and save. Microsoft’s instructions distinguish passwords used to open a workbook from those used to modify it, so check the correct field. (support.microsoft.com)

Afterward, close and reopen the saved file to verify the result. If you changed the password, test the new one before distributing the workbook. If you removed it, check that the intended copy opens without an opening-password prompt.

Removing an opening password is separate from unprotecting sheets or workbook structure. Those controls have their own protection settings. (support.microsoft.com)

Keep the password useful—and recoverable by you

Before you password protect a file in Excel, decide where you will store its password. Microsoft cannot retrieve forgotten Excel passwords. Treat password storage as part of the setup, not something to arrange after you have locked the workbook. (support.microsoft.com)

Use this practical checklist:

  • Choose a unique password. Avoid reusing your email or other account passwords. NIST warns that reuse can turn one compromised password into several compromised accounts. (nist.gov)
  • Store it in a trusted password manager. Use a clear record name so you can identify the correct workbook later. Protect the manager itself with multifactor authentication where available. (nist.gov)
  • Share the password separately from the attachment. For example, use an approved alternative communication channel rather than putting both in the same email. (learn.microsoft.com)
  • Follow organizational handling rules. Microsoft cautions that password protection alone does not make distributing sensitive personal information safe. (support.microsoft.com)

For a shared business file, also document who should hold the password and who owns the workbook. Before changing access arrangements, agree on the approved copy and a handover process. Avoid making one person’s memory the only way your team can regain access.

The takeaway

Learning how to password protect an Excel file starts with choosing the right control: file encryption for opening access, sheet protection for cell edits, and workbook protection for sheet structure. These options serve different purposes, even when their labels sound similar. (support.microsoft.com)

Set the appropriate protection, save the workbook, and test the exact copy you plan to use or share. Keep its password somewhere secure and accessible to authorized people.

Sources

  1. Protect an Excel file | Microsoft Support
  2. cag.gov.in: CourseMaterial 05ef48b7fa20e43 64993374
  3. Cannot Password Protect an excel file? - Microsoft Q&A
  4. Change or remove workbook passwords | Microsoft Support
  5. Protect a workbook | Microsoft Support
  6. Differences between using a workbook in the browser and in Excel | Microsoft Support
  7. Protection and security in Excel | Microsoft Support
  8. Protect a worksheet | Microsoft Support
  9. How Do I Create a Good Password? | NIST