How to lock a value in excel
Tutor 5 (154 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To make a value fixed inside formulas, use absolute references with dollar signs so the row and/or column do not shift when formulas are copied.
-
Use
$A$1to lock both column and row. -
Use
$A1to lock the column only. -
Use
A$1to lock the row only. -
While editing a cell formula, press F4 (Windows) or Command+T (Mac) to toggle through absolute/relative reference options for the selected reference.
Example
-
Suppose the interest rate is in cell
B1and the loan amount is inA2. -
In cell
C2enter=A2 * $B$1so the formula always uses the rate inB1when copied down.
Can I lock values in a workbook so the structure cannot be changed?
Yes. To prevent people from inserting, deleting, hiding, or moving sheets, protect the workbook structure.
-
On Windows: Go to Review → Protect Workbook → choose Protect workbook structure. Enter a password (optional) and confirm.
-
On Mac: Go to Review → Protect Workbook or Tools → Protection → Protect Workbook in older versions. Enter a password (optional) and confirm.
How can I prevent changes from users while allowing them to enter data in specific cells?
To allow data entry in specific cells while protecting the rest, unlock those cells and then protect the sheet.
-
Unlock the editable ranges (see steps under “How do I lock a cell so it cannot be edited?”).
-
Protect the sheet and choose allowed actions, such as Select unlocked cells or Use AutoFilter when enabling protection.
-
Optionally, use Allow Users to Edit Ranges (Windows: Review → Allow Users to Edit Ranges) to set password-protected ranges that some users can edit without unlocking the entire sheet.
How secure is sheet protection?
No. Sheet protection is suitable for preventing accidental edits and casual tampering, but it is not foolproof against determined attackers. Use strong passwords and consider file-level encryption and access controls for sensitive data.
How do I lock a value inside a cell so it cannot be changed but remains visible?
To lock a visible value, mark the cell as Locked (Format Cells → Protection → Locked) and then protect the sheet (Review → Protect Sheet). The value remains visible, but editing is blocked.
What should I do if I forget the sheet password?
No. You cannot reliably recover a lost worksheet protection password from within Excel. Use a saved copy without protection, a documented password manager, or authorized tools that comply with policy and licensing. Keep secure backups to avoid loss.
Which method should I use for different goals?
-
Prevent edits by other users → Use cell locking + Protect Sheet.
-
Keep a reference constant in formulas → Use absolute references with
$. -
Restrict adding/removing sheets → Use Protect Workbook (structure).
-
Allow controlled editing by some users → Use Allow Users to Edit Ranges and sheet protection.
How do Windows and Mac differ in locking cells and protecting sheets?
To lock cells and protect a sheet, the steps are the same conceptually on both platforms: set cell Locked flags, then Protect Sheet. Menu names may differ by Excel version.
-
Windows path: Format Cells (right-click) → Protection → lock/unlock; then Review → Protect Sheet.
-
Mac path: Format Cells (right-click) → Protection → lock/unlock; then Review → Protect Sheet, or Tools → Protection → Protect Sheet in older releases.
-
Windows has Allow Users to Edit Ranges in the Review tab; some Mac versions may not show that option or place it under Tools → Protection.
-
Keyboard shortcut for toggling absolute references: F4 on Windows, Command+T on Mac.
How do I test that the lock works?
To test that locking worked, unprotected areas should be editable and locked cells should not accept input.
-
Save a copy of the workbook.
-
Try editing a locked cell; Excel should show a message preventing the change.
-
Edit an unlocked cell to confirm allowed edits function correctly.
-
Unprotect the sheet to confirm you can restore editing after entering the password.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to copy conditional formatting in excel
Answers · 1
How to multiply percentages in excel
Answers · 1
How to multiply all cells by a number in excel
Answers · 1
How to multiply by pi in excel
Answers · 1