How to lock formula in excel
Tutor 5 (70 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To lock a formula in Excel, you use the dollar sign ($) before the column letter and/or row number in cell references, creating absolute references that don't change when you copy the formula to other cells.
What Are Cell References in Excel
Cell references in Excel come in three types: relative (A1), absolute (A$1), and mixed ( A1 or A$1). Relative references change when you copy formulas to different cells. Absolute references remain fixed regardless of where you paste the formula. Mixed references lock either the column or row while allowing the other to change.
How to Create Absolute References
To create an absolute reference in your formula, place a dollar sign before both the column letter and row number. You type $A$1 instead of A1 in your formula. The keyboard shortcut F4 (Windows) or Command+T (Mac) cycles through reference types after selecting a cell reference in the formula bar.
Methods to Lock Formulas
Method 1: Using Dollar Signs Manually
- Click the cell containing your formula
- Select the formula bar
- Add $ before the column letter and row number for each reference you want to lock
- Press Enter to confirm the change
Method 2: Using F4 Keyboard Shortcut (Windows) or Command+T (Mac)
- Select the cell with your formula
- Click in the formula bar and highlight the cell reference
- Press F4 (Windows) or Command+T (Mac) to cycle through reference types
- Press Enter when you reach the desired reference type
Method 3: Protecting Cells with Formulas
- Select all cells in your worksheet (Ctrl+A on Windows, Command+A on Mac)
- Right-click and select Format Cells
- Go to the Protection tab and uncheck "Locked"
- Select only the cells containing formulas you want to lock
- Right-click and select Format Cells
- Check "Locked" in the Protection tab
- Go to the Review tab and click "Protect Sheet"
- Set a password and select protection options
- Click OK to apply protection
Types of Formula Locking
Absolute Reference ($A$1): Locks both column and row. The reference stays at A1 regardless of where you copy the formula.
Column Absolute Reference ($A1): Locks only the column. The column stays at A while the row number adjusts based on the paste location.
Row Absolute Reference (A$1): Locks only the row. The row stays at 1 while the column letter adjusts based on the paste location.
Common Scenarios for Locking Formulas
Tax Calculations: You lock the cell containing the tax rate (8.5%) when calculating tax amounts for multiple products. The formula =B2*$D$1 ensures the tax rate cell D1 remains constant while product prices in column B change.
Commission Calculations: Sales representatives earn 12% commission on sales. The formula =C5*$B$1 locks the commission rate in B1 while allowing sales amounts in column C to vary.
Currency Conversions: Converting prices using an exchange rate of 1.15 requires locking the rate cell. The formula =A10*$E$2 keeps the exchange rate in E2 fixed while converting different amounts in column A.
How to Lock Formulas When Using Tables
Excel tables use structured references that behave differently from standard cell references. To lock a reference in a table formula, you convert the structured reference to a standard reference or use the INDIRECT function. The formula =[@Sales]Table1[[#Headers],[Commission]] automatically adjusts, but =[@Sales]$B$1 creates a fixed reference to cell B1.
Troubleshooting Locked Formula Issues
Formula Not Staying Locked: Verify dollar signs appear before both column and row ($A$1). Check that worksheet protection is active through Review > Protect Sheet.
Cannot Edit Locked Formula: Unprotect the sheet using Review > Unprotect Sheet. Enter the password set during protection. Make necessary edits and reprotect the sheet.
Mixed References Not Working: Ensure you place the dollar sign in the correct position. $A1 locks the column, A$1 locks the row.
Best Practices for Formula Locking
Name your constant cells using Define Name in the Formulas tab for easier reference management. Document which cells contain locked formulas using cell comments or a separate documentation sheet. Test your formulas by copying them to different locations before finalizing your spreadsheet. Use consistent locking patterns throughout your workbook for maintainability.
. Was this Helpful?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 add secondary axis in excel
Answers · 1
How to switch columns to rows in excel
Answers · 1
How to subtract on excel
Answers · 1
How to combine two cells of text in excel
Answers · 1