Formula Errors

Protect an Excel Formula While Allowing User Input

Huda QurayshiHuda Qurayshi Nov 20, 2026 868 views

Question details

Protect a spreadsheet formula while allowing users to enter an optional replacement value.

How to Protect an Excel Formula While Allowing User Input
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.
Before you start

Choose separate cells for the original formula, optional input, and displayed result. The example below uses A1, B1, and C1 respectively.

Solution 1Recommended

Use Separate Formula, Input, and Result Cells

Keep the original formula protected while users enter an optional override in an unlocked cell.

1
Enter the original formula

Enter your original calculation in A1. Leave B1 empty for the optional user input.

2
Create the result formula

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.

3
Set cell protection

Select B1, open Format Cells, and clear Locked on the Protection tab. Check that Locked is selected for A1 and C1.

4
Protect and test the sheet

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.

Use Separate Formula, Input, and Result Cells
Blank input uses the formula: This setup treats a blank B1 as no override. Users cannot enter a value directly into C1 without replacing its formula.
Try WPS Spreadsheets

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. 1. Open your spreadsheet: Open WPS Spreadsheets and use File > Open to select your workbook.
  2. 2. Set up the cells: Enter your original formula in A1, leave B1 blank, and enter =IF(B1="",A1,B1) in C1.
  3. 3. Unlock the input: Select B1, open Format Cells, and clear Locked on the Protection tab. Keep A1 and C1 locked.
  4. 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.
Preserve formulas while allowing optional user overridesOpen and save Microsoft Excel XLSX filesUse familiar spreadsheet formulas and cell protectionWork with a free, easy-to-use office suite
microsoft office alternative - wps office

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.