Protect an Excel Formula While Allowing User Input
Question details
Protect a spreadsheet formula while allowing users to enter an optional replacement value.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet needs to show a calculated result by default but allow a user to override it.
- Observed behavior
- A cell cannot retain its formula if a user types a replacement value directly into that cell.
Choose separate cells for the original formula, optional input, and displayed result. The example below uses A1, B1, and C1 respectively.
Use Separate Formula, Input, and Result Cells
Keep the original formula protected while users enter an optional override in an unlocked cell.
Enter your original calculation in A1. Leave B1 empty for the optional user input.
Enter =IF(B1="",A1,B1) in C1. It displays A1's result when B1 is blank and B1's value when an override is entered.
Select B1, open Format Cells, and clear Locked on the Protection tab. Check that Locked is selected for A1 and C1.
Go to Review > Protect Sheet, set a password if desired, and allow selection of unlocked cells. Enter a value in B1 to test the override, then clear B1 to restore the calculated result.

Protect Formulas and Allow Overrides in WPS Spreadsheets
Use separate formula, input, and result cells in WPS Spreadsheets, then protect the sheet so users can edit only the input cell.
- 1. Open your spreadsheet: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. Set up the cells: Enter your original formula in A1, leave B1 blank, and enter =IF(B1="",A1,B1) in C1.
- 3. Unlock the input: Select B1, open Format Cells, and clear Locked on the Protection tab. Keep A1 and C1 locked.
- 4. Protect and test: Use Review > Protect Sheet, then enter a value in B1 to check that C1 shows the override. Clear B1 to show the formula result again.

Frequently Asked Questions
Can I type a value into a cell without replacing its formula?
No. Typing directly into a formula cell replaces its formula. Use a separate input cell and a result formula such as =IF(B1="",A1,B1).
How do I let users edit only the input cell in Excel?
Select the input cell, open Format Cells > Protection, and clear Locked. Keep the formula cells locked, then use Review > Protect Sheet.
How can a user return to the original calculated result?
Clear the override in B1. The formula in C1 will then display the result from A1.
Will entering zero override the formula result?
Yes. With =IF(B1="",A1,B1), entering 0 in B1 makes C1 display 0. Clearing B1 restores the result from A1.




