How to Lock Cells with Formulas in Excel and Keep Inputs Editable

How to lock cells with formulas in Excel for the web: protect the sheet, leave input ranges editable, then verify a formula cannot be overwritten while an input still changes.

Excel for the webFictional practice dataEnglish captions
Start with a practice file

Try the example, then check the result.

Download the fictional material and follow the steps below. The video uses English illustrative diagrams; it does not present a live app recording. Product controls may vary by version.

Check the answer before applying the method to your own data. How we review guides ↗

Video walkthrough

Watch the complete lesson.

The video uses English illustrative diagrams; it does not present a live app recording. English captions. Product menus may differ in your account.

Quick answer. In Excel for the web, open Review > Manage Protection, protect the sheet, and set only the input range B2:C2 as an unlocked range. Keep D2 protected, then test an input edit and an attempted edit to its =B2*C2 formula.

Use the fictional practice file and independent answer check. Work in a permitted practice copy.

Before you start. Download the fictional order calculator and save a disposable copy. B2 is quantity, C2 is unit price, and D2 contains =B2*C2. The starting answer is 3 × $12.50 = $37.50. This exercise is about avoiding accidental edits, not hiding data securely.

1. Identify the inputs and formula

Open the practice workbook in Excel for the web. Check that B2 is the editable quantity, C2 is the editable unit price, and D2 contains the exact formula =B2*C2. Do not replace D2 with a typed dollar amount; the exercise relies on a real formula that recalculates when an input changes.

Checkpoint: B2 = 3, C2 = 12.50, D2 uses =B2*C2 and returns 37.50.

2. Open the web protection control

On the Review tab, open Manage Protection. Microsoft's Excel for the web guidance describes sheet protection and Unlocked ranges there. If your tenant does not show this control, stop and check its current features; do not substitute desktop Format Cells instructions while claiming this is a web demonstration.

Checkpoint: Manage Protection is available in the current Excel web session.

3. Protect the sheet and unlock inputs

Turn on Protect sheet. Add B2:C2 as an Unlocked range, and leave D2 out of that range. If you chose more than one input range, check each address carefully before saving. The formula cell must remain under sheet protection while the two inputs stay editable.

Checkpoint: B2:C2 appears as an unlocked range; D2 does not.

4. Test an allowed edit

Change B2 from 3 to 4 in the protected practice copy. D2 should recalculate to $50.00 because 4 × $12.50 = $50.00. This test proves the input range is still usable. Then restore B2 to 3 so the practice workbook returns to its starting value.

Checkpoint: The changed quantity is accepted and D2 recalculates; B2 is restored.

5. Test a blocked formula edit

Attempt to type 999 into D2 while protection remains on. The formula must resist replacement. Cancel the attempt rather than changing the workbook's intended answer. If D2 accepts 999, inspect the protected-sheet state and the unlocked range address; the protection setup is not yet correct.

Checkpoint: D2 still contains =B2*C2 and returns $37.50 after restoration.

Verify the result

With protection on, B2:C2 accepts an edit while D2 rejects replacement. Starting values B2 = 3 and C2 = 12.50 yield D2 = 37.50; changing B2 to 4 yields 50.00, then restoring B2 yields 37.50 again. The current app behavior remains a viewer check until a live Excel web test is recorded.

If it still does not work

If both inputs and formula are blocked, recheck that B2:C2 is explicitly listed as an Unlocked range. If D2 remains editable, check that sheet protection is on and that D2 was not accidentally included in the unlocked range. Microsoft describes worksheet protection as an edit guard, not a security feature for confidential data.

Official sources

The branded video panels are illustrative diagrams unless a panel is explicitly marked as an actual app capture. The current controls and result must be checked in your own account; an illustration is not proof of an observed live result.

Take the example with you

Practice downloads.

The exercise files contain invented information. Save a local copy before editing.

Keep exploringBrowse published workshop guides