How to Lock Formulas in Excel
Last Updated :
11 Oct, 2024
Are you tired of accidentally altering formulas in your Excel spreadsheets? Locking formulas in Excel is essential for maintaining the integrity of your data and ensuring that your calculations remain accurate. In this comprehensive article, you will learn the effective techniques to protect your Excel formulas from unintended changes, helping you keep your data secure.
From understanding cell references to utilizing the $ shortcut for absolute references, we’ll cover everything you need to know. Whether you’re a beginner or an advanced user, mastering how to lock formulas will enhance your productivity and data management skills. Let’s get into the straightforward process of locking your Excel formulas and safeguarding your valuable calculations!
In this article, we will discuss how to lock and protect the formulas within the Excel sheet along with an example.
Lock Formulas in Excel Understanding Cell References
Before we explore the $ shortcut, it's crucial to grasp the concept of cell references. In Excel formulas, cell references indicate which cells to include in calculations. There are three main types of cell references:
Relative References
These are the default references in Excel. When you copy and paste a formula to a new cell, the references adjust relative to the formula's new position.
Absolute References
Unlike relative references, these references remain constant when you copy and paste a formula. You create an absolute reference by placing a $ symbol before the column letter and row number, like this: $A$1.
Mixed References
These references enable you to lock either the column or row, but not both. Create a mixed reference by adding a $ symbol before either the column letter or row number, such as $A1 or A$1.
In this section, we’ll provide a step-by-step guide on how to lock formulas using the dollar sign to create absolute references. This method is vital for maintaining consistent references in your calculations.
Step 1: Open the Spreadsheet
Open the sheet you want to lock formulas in.

In this sheet we want to multiply the price with the units to calculate total units for every day.
Enter the formula for one row as shown below.

Step 3: Locking the Reference to Cell B1
Now, we want to lock the reference to the cell "B1" because we want it to stay same for all the rows. When the formula is dragged the value of "B1" cell should remain the same.
Place the cursor at the end of B1 which is entered in the formula shown in the cell "C4" in the below image.

Press "F4". You can confirm that the reference to the cell "B1" is locked when you see dollar sign($) placed in front of "B1" in the formula. As shown in the image below, like "$B$1".

Step 4: Preview Result
Press "Enter", you will see that the value is been calculated.


Learn how to lock formulas while keeping the workbook accessible. This method allows users to edit other cells without altering locked formulas, ensuring data integrity.
Step 1: Open the spreadsheet
Suppose we have an Excel as follows which contains some calculations done with the help of formulas.

Step 2: Unlock all Cells
1. Select the whole excel sheet by pressing Ctrl + A.

Right click while the cells are selected. Click on "Format Cells" option or Press Ctrl + 1.
-660.png)
Step 4: Go to the Protection Tab
The below box will now open. Choose the "Protection" tab.

Step 5: Unmark the Locked Checkbox and Click Ok
Observe the "Locked" option is marked. Unmark this checkbox

1. Next go to the "Home" section. Select "Find & Select" option.

2. Completing the above step will open a dialog box as shown below. Click on "Go to Special".

3. This will open a separate dialog box as shown below.

4. Choose the "Formulas" option. Click "Ok".

5. After the above step. All the cells containing formulas will be selected as shown below.

Step 7: Lock the cells
1. Now press Ctrl + 1. In the "Protection" tab check the "Locked" and "Hidden" option.

2. The options will look as below. Click "Ok". All the cells containing formulas are now locked and hidden.

Step 8: Protect the cells
1. While the all the locked formula cells are still selected. Go to "Review" section.

2. Choose the "Protect Sheet" option.

3. Now in the "Protect Sheet" dialog box, enter a password to secure the sheet. After you have entered the password click "Ok".

4. Confirm the password by re-entering it. Click on "Ok".

The formulas are now safe and protected. You are free to make changes to any of the cells as you like. However, if you attempt to edit the cells that have the formulas, a message box will appear a shown below.
This section covers how to quickly lock cell references using keyboard shortcuts, making the process efficient for users.
Step 1: Select the Cell
Select the cell with the formula you want to lock.

Press "F4" on the keyboard to lock the cell reference of the formula.
Step 3: Repeat the process
Repeat the process for all the other cells with formulas you want to lock.
Here, we explain how to remove protection and unhide formulas when you need to make changes to your spreadsheet.
Step 1: Open the spreadsheet

Step 2: Unprotect the cells
1. Go to the "Review" section. Click on "Unprotect Sheet" option.

2. After completing the above step the below dialog box will open.

3. Enter the password you provided during protecting the cells.

Now the cells are unprotected.
1. Press Ctrl + A to select all the cells of the sheet.

2. Right click and select the "Format cells" option.
-660.png)
3. On the popped-up dialog box, go to "Protection" tab. Uncheck the "Locked" and "Hidden" option to unhide the formulas. Click on "Ok".

Now the formulas are unhidden and unlocked.
Also Read
Conclusion
Locking formulas in Excel is a vital skill for anyone who wants to maintain the integrity of their data and streamline their workflow. By following the techniques outlined in this article, you can easily protect your calculations and prevent unwanted changes. Remember, Excel is not just a tool; it’s a powerful ally in your data management journey. If you found this guide helpful, share your experiences in the comments below or explore our other articles on Excel tips and tricks to enhance your skills further!
Similar Reads
How to Show Formulas in Excel
Exploring the art of Excel formulas can turn up your data analysis and reporting capabilities. Whether youâre a financial analyst, digital marketer, or an Excel learner, understanding how to display formulas in Excel is important. This article will make you learn the simple steps to show the formula
4 min read
How to Use Fractions in Excel
Fractions are often necessary for accurately representing data in real-world situations such as recipe measurements, construction projects, financial calculations, and even classroom teaching. For example, chefs might need to work with precise ingredient ratios, while engineers rely on fractional me
6 min read
How to Create an Array Formula in Excel?
Array formulas in excel are important tools. A single formula can perform multiple calculations and replace thousand of useful formulas. Most of us have never used array functions in our excel sheet just because we don't know how to use these formulas. Array formulas is one of the most confusing exc
10 min read
How to add Filters in MS Excel?
Microsoft Excel is software that allows users to store or analyze data in a proper systematic manner. It uses spreadsheets to organize numbers and data with formulas and functions. If your worksheet contains a lot of content, seeking out information quickly can be difficult. Filters are often used t
4 min read
How to Create a Formula in Excel using Java?
Apache POI is a popular open-source Java library that provides programmers with APIs for creating, modifying, and editing MS Office files. Excel is very excellent at calculating formulas. And perhaps most Excel documents have formulas embedded. Therefore, itâs trivial that on a fine day, you have to
3 min read
How to Use For Next Loop in Excel VBA?
If you are familiar with the programming you must have an idea of what a loop is, In computer programming, a loop is a sequence of statements that are repeated until a specific condition is satisfied. In Excel VBA the "For Next" loop is used to go through a block of code a specific number of times.
4 min read
How to Use ChatGPT to Write Excel Formulas
Worrying about mastering Excel formulas? Thinking about the right syntax and function for hours? If you are, ChatGPT has got you covered! Discover how ChatGPT makes Excel formula writing effortless in the following article. In data analysis, Excel formulas reign supreme as a crucial tool. They make
5 min read
Array Formulas in Excel
Excel is among the most powerful and widely used spreadsheet tools which eases organizing numbers and data within the sheets with pre-built formulas and functions. In this article, we are going to study Array Formulas. Arrays are one of them. Using Excel Array Formulas, make it super easy to handle
8 min read
How to Remove Grid lines in Excel
When you open the Excel sheet, you see a cross-section of rows and columns with grey-coloured lines that separate cells. Those gray-colored lines are known as gridlines in MS Excel. The grey color is the default color offered by Microsoft and one can change the color of the gridlines. These Guidelin
10 min read
How to Break Links in Excel?
In this article, we explain two different ways to break links in excel. When we move a sheet from different workbooks. There are chances of having external links between workbooks. We used to get the below warning message while opening the excel file with an external link. We explain with two files
2 min read