Excel Security
Excel Security Interview with follow-up questions
1. Can you explain how to protect a worksheet in Excel?
Worksheet protection controls what users can do on a specific sheet, without affecting other sheets in the workbook.
How to protect a worksheet:
- (Optional) First, set which cells should remain editable by unlocking them: select those cells → right-click → Format Cells → Protection tab → uncheck Locked. By default, all cells are locked, but locking only takes effect once protection is on.
- Go to Review → Protect Sheet.
- In the dialog, optionally enter a password.
- Check or uncheck the actions you want to permit: selecting locked/unlocked cells, formatting cells, inserting/deleting rows or columns, sorting, using AutoFilter, editing PivotTables, etc.
- Click OK. If you set a password, confirm it.
What protection does and does not do:
- Protected cells cannot be edited or deleted while protection is on.
- Formulas in locked cells are still visible in the formula bar unless you also mark cells as Hidden (Format Cells → Protection → Hidden) before enabling protection.
- Worksheet protection is not strong encryption — it prevents casual editing but is not a substitute for file-level password encryption for sensitive data.
Removing protection: Review → Unprotect Sheet → enter the password if one was set.
Interview tip: Interviewers often ask about the difference between locking cells and protecting a sheet. Locking is a cell property that has no effect until you turn on sheet protection — they work together.
Follow-up 1
What are the steps to unprotect a worksheet?
To unprotect a worksheet in Excel, follow these steps:
- Open the Excel worksheet that is protected.
- Click on the 'Review' tab in the Excel ribbon.
- In the 'Changes' group, click on the 'Unprotect Sheet' button.
- If the worksheet is protected with a password, you will be prompted to enter the password. Enter the correct password and click on the 'OK' button.
Once the worksheet is unprotected, you will be able to make changes to the protected cells and modify the structure of the worksheet.
Follow-up 2
What happens when a worksheet is protected?
When a worksheet is protected in Excel, it restricts the actions that users can perform on the protected sheet. The specific actions that are restricted can be set by the person who protected the sheet. By default, when a worksheet is protected, users are not able to make changes to the protected cells or modify the structure of the worksheet. They can only perform the actions that have been allowed by the person who protected the sheet, such as selecting cells, formatting cells, inserting rows or columns, etc.
Follow-up 3
Can you explain the difference between protecting a worksheet and protecting a workbook?
Protecting a worksheet and protecting a workbook are two different actions in Excel:
Protecting a worksheet restricts the actions that users can perform on that specific sheet. Users will only be able to perform the actions that have been allowed by the person who protected the sheet.
Protecting a workbook, on the other hand, restricts the actions that users can perform on the entire workbook. When a workbook is protected, users will not be able to add, delete, hide, or unhide worksheets. They will also not be able to move, copy, rename, or create new sheets. Additionally, protecting a workbook can also prevent users from changing the structure of the workbook, such as adding or deleting columns or rows.
In summary, protecting a worksheet restricts actions on that specific sheet, while protecting a workbook restricts actions on the entire workbook.
Follow-up 4
What are some common scenarios where protecting a worksheet might be necessary?
There are several common scenarios where protecting a worksheet in Excel might be necessary:
Sharing sensitive information: If you need to share a worksheet that contains sensitive information, such as financial data or personal information, protecting the worksheet can help prevent unauthorized users from making changes to the data.
Preventing accidental changes: If you have a worksheet that is used as a template or a reference, protecting the worksheet can help prevent accidental changes to the formulas, formatting, or structure of the worksheet.
Collaborating with others: If you are collaborating on a worksheet with multiple users, protecting the worksheet can help ensure that only authorized users can make changes to the data, while others can only view or interact with the worksheet.
These are just a few examples, but there can be many other scenarios where protecting a worksheet can be beneficial.
2. How can you lock cells in Excel to prevent unauthorized changes?
By default, all cells in Excel are set to "Locked," but locking only activates when sheet protection is turned on. The workflow has two stages:
Stage 1 — Configure which cells should be locked:
If you want most cells locked but some editable (e.g., data-entry cells):
- Select the entire sheet (Ctrl+A).
- Right-click → Format Cells → Protection tab → uncheck Locked. This unlocks all cells.
- Select only the cells you want to lock (e.g., formula cells, headers).
- Right-click → Format Cells → Protection tab → check Locked.
If you want all cells locked, skip this stage — locked is the default.
Stage 2 — Enable sheet protection:
- Go to Review → Protect Sheet.
- Optionally set a password.
- Specify what unprotected users can do (typically allow selecting unlocked cells, possibly sorting or filtering).
- Click OK.
Result: Locked cells are now read-only. Users can edit unlocked cells freely. Attempting to edit a locked cell displays a warning message.
Protecting across multiple sheets: Use a macro or the right-click context menu on the sheet tab → Protect Sheet to apply protection sheet by sheet. There is no single button to protect all sheets at once without VBA.
Workbook structure protection (Review → Protect Workbook) is separate — it prevents adding, deleting, renaming, moving, or hiding sheets, but does not lock cell contents. Both can be active simultaneously.
Follow-up 1
What happens when a cell is locked?
When a cell is locked in Excel, it means that the cell is protected and users cannot make changes to its content or formatting unless they know the password to unprotect the sheet. By default, all cells in a worksheet are locked, but they are only protected when the worksheet is protected. Locking a cell alone does not prevent changes; you need to protect the worksheet to enforce the cell locking.
Follow-up 2
Can you lock only certain cells in a worksheet?
Yes, you can lock only certain cells in a worksheet. By default, all cells in a worksheet are locked, but you can selectively unlock specific cells while keeping the rest of the cells locked. To do this, follow these steps:
- Select the cells you want to unlock.
- Right-click on the selected cells and choose 'Format Cells' from the context menu.
- In the 'Format Cells' dialog box, go to the 'Protection' tab.
- Uncheck the 'Locked' checkbox.
- Click on the 'OK' button.
Once you have unlocked the desired cells, protect the worksheet to enforce the cell locking for the remaining cells.
Follow-up 3
How can you unlock a cell?
To unlock a cell in Excel, you need to follow these steps:
- Select the cell you want to unlock.
- Right-click on the selected cell and choose 'Format Cells' from the context menu.
- In the 'Format Cells' dialog box, go to the 'Protection' tab.
- Uncheck the 'Locked' checkbox.
- Click on the 'OK' button.
Once you have unlocked the cell, you need to protect the worksheet to enforce the cell locking for the remaining cells.
Follow-up 4
What are some scenarios where locking cells might be useful?
Locking cells in Excel can be useful in various scenarios, including:
Protecting formulas: By locking cells containing formulas, you can prevent accidental changes to the formulas, ensuring the integrity of your calculations.
Data entry: If you have a worksheet where users need to enter data in specific cells, you can lock the other cells to prevent accidental changes or overwriting of existing data.
Preserving formatting: Locking cells can help preserve the formatting of important data or headings, preventing users from accidentally modifying the formatting.
Collaboration: When multiple users are working on a shared worksheet, locking cells can help maintain data consistency and prevent unauthorized changes.
These are just a few examples, and the usefulness of locking cells may vary depending on the specific requirements of your Excel workbook.
3. What are some other security features available in Excel?
Beyond worksheet and cell protection, Excel provides several additional security layers:
1. Workbook-level password (open password): File → Info → Protect Workbook → Encrypt with Password. The workbook is AES-256 encrypted; without the password, the file cannot be opened. This is genuine encryption, unlike sheet protection.
2. Password to modify (write-protect): When saving: File → Save As → Tools → General Options → set a "Password to modify." Users without this password can open the file in read-only mode.
3. Protect Workbook structure: Review → Protect Workbook → Structure. Prevents adding, deleting, renaming, moving, hiding, or unhiding worksheets. Optionally password-protected.
4. Mark as Final: File → Info → Protect Workbook → Mark as Final. Sets the file to read-only and disables editing. This is advisory, not enforced — any user can re-enable editing. Use for signaling finality, not security.
5. Digital Signatures: File → Info → Protect Workbook → Add a Digital Signature. Certifies the workbook's authenticity and detects tampering. If the file is altered after signing, the signature becomes invalid.
6. Information Rights Management (IRM): File → Info → Protect Workbook → Restrict Access (requires Azure AD / Microsoft 365 subscription). Limits who can open, edit, copy, or print the workbook and can enforce expiry dates — enforced at the service level, not just within Excel.
7. Trusted Documents and Protected View: Files opened from the internet or email attachments open in Protected View (sandboxed, read-only) by default. Users must explicitly click "Enable Editing." Configure in File → Options → Trust Center.
8. Macro security: Controlled via File → Options → Trust Center → Macro Settings — restricts which macros can run (see the macros security question for detail).
Follow-up 1
What is the 'Mark as Final' feature in Excel?
The 'Mark as Final' feature in Excel is used to indicate that a workbook is final and should be considered read-only. When a workbook is marked as final, it becomes read-only, and a message is displayed at the top of the workbook to inform users that the file is final and should not be modified. This feature is useful when you want to share a workbook for review or distribution purposes and want to discourage any further changes to the file. However, it's important to note that marking a file as final does not provide any security or password protection. It is simply a visual indication that the file is considered final.
Follow-up 2
Can you explain how to set a password for an Excel file?
To set a password for an Excel file, follow these steps:
Open the Excel file you want to password protect.
Click on the 'File' tab in the ribbon.
Select 'Protect Workbook' from the dropdown menu.
Choose 'Encrypt with Password'.
Enter a password of your choice and click 'OK'.
Confirm the password by entering it again and click 'OK'.
Save the file to apply the password protection.
Now, whenever someone tries to open the file, they will be prompted to enter the password.
Follow-up 3
What is the 'Read Only' option in Excel?
The 'Read Only' option in Excel allows you to open a file in a mode that prevents any changes from being saved to the original file. When a file is opened in 'Read Only' mode, you can view and interact with the contents of the file, but you cannot make any modifications or save the changes. This option is useful when you want to share a file with others for viewing purposes only, without allowing them to edit or accidentally modify the original file.
Follow-up 4
How can you restrict editing in an Excel file?
To restrict editing in an Excel file, you can set a password for modifying the file. Here's how:
Open the Excel file you want to restrict editing.
Click on the 'File' tab in the ribbon.
Select 'Protect Workbook' from the dropdown menu.
Choose 'Protect Current Sheet'.
Enter a password of your choice and click 'OK'.
Confirm the password by entering it again and click 'OK'.
Save the file to apply the editing restrictions.
Once the file is protected with a password, anyone who wants to make changes to the file will need to enter the password. Without the password, the file can only be opened in read-only mode.
4. How can you hide formulas in Excel for security purposes?
Hiding a formula makes it invisible in the formula bar while the cell still displays its result. This prevents users from copying or reverse-engineering your formulas.
Steps to hide formulas:
- Select the cells containing the formulas you want to hide.
- Right-click → Format Cells → Protection tab.
- Check Hidden (you can leave Locked checked as well — typically you want both).
- Click OK.
- Enable worksheet protection: Review → Protect Sheet → optionally set a password → OK.
Once protection is on, clicking a cell with a hidden formula shows no formula in the formula bar — just the cell value.
Important nuance:
- The Hidden property has no effect until sheet protection is active. Without protection, formulas are always visible regardless of the Hidden checkbox.
- Hidden formulas are still there — they are not deleted. If a user unprotects the sheet (and knows the password), they can see the formulas. This is obscurity, not cryptographic protection.
Stronger alternatives:
- If the formula uses sensitive business logic that must truly be protected, consider moving the calculation to a VBA User-Defined Function in a locked VBA project (VBA Editor → Tools → VBAProject Properties → Protection tab → Lock project for viewing). Even then, determined users can extract it.
- For highly sensitive calculations, keep them server-side (e.g., in Power BI, a database, or an API) and return only the result to Excel.
Interview tip: Interviewers expect you to know that "Hidden" and "Locked" are different properties — Hidden hides the formula from the formula bar; Locked prevents editing. Both require sheet protection to take effect.
Follow-up 1
What happens when a formula is hidden?
When a formula is hidden in Excel, it is not visible in the formula bar or in the cell itself. However, the result of the formula is still displayed in the cell. This means that users can see the calculated value of the formula, but they cannot see the actual formula itself.
Follow-up 2
Can you still see the result of a hidden formula?
Yes, even though the formula is hidden, the result of the formula is still visible in the cell. Users can see the calculated value of the formula, but they cannot see the actual formula itself.
Follow-up 3
How can you unhide a hidden formula?
To unhide a hidden formula in Excel, you can use the following steps:
- Select the cell or range of cells containing the hidden formula(s).
- Right-click on the selected cell(s) and choose 'Format Cells' from the context menu.
- In the 'Format Cells' dialog box, go to the 'Protection' tab.
- Uncheck the 'Hidden' checkbox under the 'Protection' section.
- Click 'OK' to apply the changes.
By following these steps, the hidden formulas will be unhidden and visible in the formula bar and in the cells.
Follow-up 4
What are some scenarios where hiding formulas might be necessary?
Hiding formulas in Excel might be necessary in the following scenarios:
- Protecting sensitive information: If the formulas contain sensitive data or proprietary calculations, hiding them can help protect the information from unauthorized access.
- Preventing accidental changes: Hiding formulas can prevent accidental changes or deletions by users who do not need to see or modify the formulas.
- Simplifying the worksheet: Hiding formulas can make the worksheet less cluttered and easier to read, especially if there are many complex formulas involved.
- Presenting a clean report: Hiding formulas can be useful when presenting the worksheet as a report or presentation, as it allows the focus to be on the results rather than the underlying calculations.
5. Can you explain how to use the 'Protect Workbook' feature in Excel?
The Protect Workbook feature (not to be confused with worksheet protection or file encryption) controls the structure of the workbook — preventing users from adding, deleting, renaming, moving, hiding, or unhiding worksheets.
How to use it:
- Go to Review → Protect Workbook.
- Ensure Structure is checked (it is by default).
- Optionally enter a password, then click OK.
Once active, the sheet tab right-click menu greys out Insert, Delete, Rename, Move or Copy, Hide, and Unhide options. Users can still edit cell contents — this does not protect cell data.
What it protects:
- Sheet tab operations (add, delete, rename, reorder, hide/unhide sheets)
- The workbook's window arrangement (the "Windows" option, now hidden in modern Excel, controlled resizing of workbook windows in older MDI-style Excel)
What it does NOT protect:
- Cell contents — users can still edit any unprotected cell.
- The file from being opened — use File → Info → Protect Workbook → Encrypt with Password for that.
- Individual sheets — use Review → Protect Sheet on each worksheet.
Combined protection strategy (interview-ready answer): | Goal | Feature | |------|---------| | Prevent opening without a password | Encrypt with Password | | Prevent editing specific cells | Lock cells + Protect Sheet | | Hide formulas | Mark Hidden + Protect Sheet | | Prevent adding/deleting/renaming sheets | Protect Workbook (Structure) | | Restrict who can access or print | IRM (Microsoft 365) |
Removing the protection: Review → Protect Workbook (toggle off) → enter the password if set.
Note: The password for Protect Workbook is independent of sheet-level passwords — each must be managed separately.
Follow-up 1
What are the steps to unprotect a workbook?
To unprotect a workbook in Excel, follow these steps:
- Open the protected Excel workbook.
- Click on the 'File' tab in the ribbon.
- In the backstage view, click on 'Protect Workbook' under the 'Info' section.
- Select the 'Unprotect Workbook' option from the dropdown menu.
- If the workbook is password-protected, enter the password and click on 'OK'.
Note: You can only unprotect a workbook if you know the password or if the workbook is not protected with a password.
Follow-up 2
What happens when a workbook is protected?
When a workbook is protected in Excel, it depends on the protection option chosen:
- If the 'Mark as Final' option is selected, the workbook becomes read-only and any changes made to it will require saving it with a different name.
- If the 'Encrypt with Password' option is selected, the workbook can only be opened by entering the correct password.
- If the 'Restrict Editing' option is selected, specific actions such as editing, formatting, or adding comments may be restricted based on the chosen editing restrictions.
Note: Protecting a workbook does not prevent others from opening it, but it restricts certain actions depending on the chosen protection options.
Follow-up 3
How is protecting a workbook different from protecting a worksheet?
Protecting a workbook and protecting a worksheet are two different features in Excel:
- Protecting a workbook applies protection to the entire workbook, including all worksheets and their structure.
- Protecting a worksheet, on the other hand, applies protection only to the specific worksheet, restricting actions such as editing, formatting, or deleting.
In summary, protecting a workbook provides a higher level of protection as it covers the entire workbook, while protecting a worksheet is more focused on protecting the content and structure of a specific worksheet.
Follow-up 4
What are some scenarios where protecting a workbook might be necessary?
Protecting a workbook in Excel might be necessary in the following scenarios:
- Sharing a workbook with others while preventing them from making changes to the overall structure or layout.
- Protecting sensitive or confidential information in the workbook from unauthorized access.
- Preventing accidental modifications to formulas or data in the workbook.
- Ensuring that the workbook is not accidentally saved with changes by marking it as final.
- Restricting specific actions, such as editing or formatting, to maintain data integrity.
These are just a few examples, and the need to protect a workbook may vary depending on the specific requirements of the Excel file and its intended use.
Live mock interview
Mock interview: Excel Security
- Read your scene and goals
- Talk it out; goals tick off live
- Get a score and stronger lines
Your voice and your AI key never touch our servers; the key stays in this browser and is sent only to Google. Only your round scores are saved to track progress.