Skip to content
Spreadsheet with locked formula cells, unlocked input cells, a frozen header row and a $A$1 absolute reference

EXCEL + GOOGLE SHEETS HOW-TO

How to Lock Cells in Excel and Google Sheets (and Protect Formulas)

"Lock cells" means three different things: stopping edits, keeping rows visible while you scroll, and fixing a reference inside a formula. This guide covers all three in both apps, with the exact menus, shortcuts and the traps to avoid.

Protect formulas, allow inputFreeze rows$A$1 reference tool

START HERE

Which "lock" do you actually need?

Most searches for "how to lock cells" are really one of these three jobs. They use different features, so pick the right one first.

MICROSOFT EXCEL

Excel: protect formulas but allow input

Here is the part that confuses everyone: in Excel every cell is already "Locked" by default, but the setting does nothing until you protect the sheet. So the workflow is backwards: first unlock the cells people should type in, then protect the sheet.

01

Select the input cells

Select every cell users are allowed to change: amounts, dates, names, categories. Hold Ctrl (⌘ on Mac) to select ranges that aren't next to each other.

02

Unlock them

Press Ctrl+1 (⌘+1 on Mac) to open Format Cells, go to the Protection tab and clear Locked. Click OK.

03

Protect the sheet

Go to Review › Protect Sheet. Keep "Select locked cells" and "Select unlocked cells" ticked, and tick anything else users need, such as Sort, Use AutoFilter or Format columns.

04

Decide on a password

A password is optional. If you set one, store it safely: Microsoft states it cannot retrieve a forgotten worksheet password.

05

Test like a user

Try typing in a formula cell (Excel should refuse) and in an input cell (it should work). Press Tab: on a protected sheet it jumps between unlocked cells, which makes data entry faster.

TaskExcel for WindowsExcel for MacExcel for the web
Unlock input cellsCtrl+1 › Protection › clear Locked⌘+1 › Protection › clear LockedReview › Manage Protection › Unlocked ranges
Protect the sheetReview › Protect SheetReview › Protect SheetReview › Manage Protection › Protect sheet
Hide formulasFormat Cells › Protection › Hidden, then protectFormat Cells › Protection › Hidden, then protectSet in the desktop app
Let specific people edit a rangeReview › Allow Edit RangesNot in the same formUnlocked ranges with an optional password

Menu names follow Microsoft 365 as of September 2026. Older versions and the web app can place commands differently.

GOOGLE SHEETS

Google Sheets: lock cells from editing

Google Sheets works the other way round from Excel. Nothing is protected until you create a protected range or sheet, and editing rights are tied to people with access to the file.

01

Open the protection panel

Go to Data › Protect sheets and ranges, then click Add a sheet or range.

02

Protect the whole sheet, except inputs

Choose Sheet, pick the tab, then tick Except certain cells and add your input ranges. This is the Sheets version of "protect formulas, allow input", and it's easier to maintain than protecting formula ranges one by one.

03

Choose warning or restriction

Click Set permissions. Show a warning still allows edits but asks people to confirm, which is ideal for your own files. Restrict who can edit blocks everyone except the people you choose.

04

Check it with a second account

You won't see the restriction as the owner, because owners can always edit. Open the file as an editor (or ask a colleague) to confirm the formula cells are really locked.

GOOD FOR

Shared team files

Restrict formula and settings tabs to yourself, leave data-entry cells open to editors, and use warnings on anything that's easy to change by accident.

KNOW THE LIMITS

What protection can't do

Sheets protection has no password, can't lock formatting while leaving values editable, and Google itself says it shouldn't be used as a security measure: people with access can still copy, download or print the data.

IMPORTANT

Cell protection is not security

Microsoft and Google say the same thing: sheet protection prevents accidental changes, it doesn't keep data private. Choose the tool that matches your goal.

GoalUseWhere
Stop accidental edits to formulasSheet protection with unlocked input cellsExcel: Review › Protect Sheet · Sheets: Data › Protect sheets and ranges
Stop people adding, deleting or renaming tabsWorkbook structure protectionExcel: Review › Protect Workbook
Stop anyone opening the file without a passwordFile encryptionExcel for Windows: File › Info › Protect Workbook › Encrypt with Password · Excel for Mac: File › Passwords
Control who can see a Google SheetSharing permissionsShare button: viewer, commenter or editor, or remove access

LOCK WHEN SCROLLING

How to lock rows and columns when you scroll

If you want the header row to stay on screen, you don't need protection. You need Freeze. It changes only your view and doesn't stop anyone editing.

What to keep visibleExcelGoogle Sheets
Top rowView › Freeze Panes › Freeze Top RowView › Freeze › 1 row
First columnView › Freeze Panes › Freeze First ColumnView › Freeze › 1 column
Several rows and columnsSelect the cell below and to the right of the area, then View › Freeze Panes › Freeze PanesClick a cell, then View › Freeze › Up to row N and Up to column X
Undo itView › Freeze Panes › Unfreeze PanesView › Freeze › No rows / No columns

LOCK A CELL IN A FORMULA

Lock a reference with $ (absolute references)

When you copy a formula, Excel and Google Sheets shift its references. That's usually helpful, until a tax rate in B1 becomes B2, B3 and so on. A dollar sign stops the shift: $ before the column letter locks the column, $ before the row number locks the row.

ReferenceTypeCopied 2 rows down and 2 columns rightTypical use
$A$1Absolute$A$1A single rate, target or setting used everywhere
A$1Mixed: row lockedC$1A header row that each column reads from
$A1Mixed: column locked$A3A label or value column that each row reads from
A1RelativeC3Row-by-row calculations

Shortcut: click inside a reference in the formula bar and press F4 to cycle A1 → $A$1 → A$1 → $A1. In Excel for Mac use ⌘+T; F4 also works in Google Sheets (on some Mac keyboards you'll need Fn+F4).

TRY IT

What happens to my reference when I copy the formula?

Enter a reference, choose which part to lock, and say how far you copy the formula. Negative numbers copy up or to the left.

Reference you type—
Type—
After copying—

The same rules apply in Excel and Google Sheets.

LIFEHACKS

Six habits that make locked sheets easy to use

  • ✓
    Color the input cellsOne light fill for every editable cell tells users where to type before they hit a protection message.
  • ✓
    Protect after the final testUnprotect, make changes, re-protect. Protection gets in your own way while you're still building.
  • ✓
    Add data validation to inputsUnlocked cells still accept anything. A dropdown or number rule keeps inputs clean (Data › Data Validation in both apps).
  • ✓
    Put settings on one tabRates, categories and targets in a single Settings tab, referenced with $, are easier to protect and update.
  • ✓
    Keep an unprotected masterSave an editable master copy and hand out protected copies, so a lost password never locks you out of your own work.
  • ✓
    Write a one-line noteA short "Type in green cells only" line at the top of each tab prevents most support questions.

WHEN IT DOESN'T WORK

Troubleshooting locked cells

ProblemLikely causeFix
I "locked" cells in Excel but can still edit themLocked only takes effect once the sheet is protected.Review › Protect Sheet.
Nobody can type anywhere after protectingAll cells were still Locked (the default).Unprotect, unlock the input cells with Ctrl+1, protect again.
Protection in Google Sheets doesn't stop meYou're the owner, or the range uses "Show a warning".Test with an editor account; switch to "Restrict who can edit".
Sort and filter stopped workingThose options weren't allowed when protecting.In Excel, unprotect, apply the filter first, then re-protect with Sort and Use AutoFilter ticked.
My $ reference still movedOnly one part was locked (A$1 or $A1), or rows were inserted above it.Use $A$1. Inserting rows or columns updates even absolute references, which is expected behavior.
Forgot the Excel sheet passwordMicrosoft can't recover it.Use your unprotected master copy. Keep one for every file you protect.

READY-MADE TEMPLATES

Prefer a spreadsheet that's already set up?

Our templates for Excel and Google Sheets separate input cells from calculated ones. If you sell spreadsheets yourself, protect the formulas before delivery and read our guide to selling PLR spreadsheets on Etsy.

FAQ

Locking cells: questions

How do I lock cells in Excel so they can't be edited?

Unlock the cells people may edit (Ctrl+1 › Protection › clear Locked), then protect the sheet with Review › Protect Sheet. All cells that are still Locked can no longer be changed.

How do I protect formulas but still allow input?

In Excel, unlock only the input cells and protect the sheet. In Google Sheets, protect the sheet via Data › Protect sheets and ranges and tick "Except certain cells" for the input ranges.

How do I lock cells in Google Sheets?

Go to Data › Protect sheets and ranges › Add a sheet or range, select the range or sheet, then Set permissions to show a warning or restrict who can edit.

How do I lock a row so it stays visible when scrolling?

Use Freeze: in Excel, View › Freeze Panes › Freeze Top Row; in Google Sheets, View › Freeze › 1 row. Freezing affects only the view.

How do I lock a cell in a formula?

Add dollar signs to make it an absolute reference, such as $B$1, or press F4 while the cursor is in the reference (Command+T in Excel for Mac). The reference then stays the same when the formula is copied.

Is sheet protection secure?

No. Microsoft and Google both describe it as a way to prevent accidental changes, not as a security feature. To keep a file private, use Excel file encryption or Google Sheets sharing permissions.

Sources and further reading

Menus and shortcuts checked September 2026 in Microsoft 365 and Google Sheets documentation. Interfaces change; if a menu has moved, search the app's help for the feature name.

Back to top