How to Lock Spreadsheet Formulas Before You Share the File

Locking formulas is simpler than most people expect. You unlock the few cells where other people need to type, then switch on protection for the rest of the sheet. Anything still locked can’t be changed by accident, and the formulas stay where you put them. The harder part is deciding which cells to unlock and understanding what protection can and can’t stop, so that you don’t end up with a file that looks safe but isn’t.

This guide walks through both.

What locking a formula actually does (and what it doesn’t)

Every cell in Excel is already marked as “locked” by default. That sounds as though your formulas are safe, but the setting does nothing until you turn on sheet protection. Until then, anyone with the file can type over any cell they like. This surprises a lot of people, and it’s the first thing to understand: the lock is a label, and protection is the switch that makes the label count.

Google Sheets works differently in the mechanics but reaches the same result. Nothing is protected until you create a protected range or protect the whole sheet, and then you choose who may edit it.

Protection stops accidents, not determined people

Sheet protection is designed to stop people from changing things by mistake. It is not a security measure. In Excel, a sheet protected without a password can be unprotected in two clicks by anyone who opens it, and a password can be removed by people who know how to look for it. Google Sheets restricts editing by account, which is stronger, but anyone you give edit access to can still copy the whole sheet into a new file, where the protection doesn’t come with it.

So think of formula locking as a guard rail against the well-meaning cousin who types a number over a total. It will do that job well. It won’t stop someone who wants to rebuild your calculations.

Why this matters for a shared file

When a file goes to several people, the most common damage is not malice. It’s a sum overwritten with a typed number, a row inserted in the middle of a formula range, or a cell dragged across and quietly breaking a reference. Each of these changes can look correct on screen while the answer underneath is wrong. Locking the formulas removes most of these routes, which is why it’s worth doing before the file leaves your hands.

Small Business Command Center

Skip the setup

Small Business Command Center

Clients, invoices, expenses and tasks in one workbook. A good fit if you run the business from a single file.

See it on Taskdale →

Before you start: decide which cells people should change

The most important job happens before you touch any menu. You need to sort the sheet into three kinds of cells: inputs (where people type), formulas (where the working happens) and labels (headings and notes that should stay put).

Sorting cells into inputs, formulas and labels

Go through the sheet with a pencil and mark each cell. Inputs are the numbers or words someone is expected to enter, such as a monthly bill amount or a name. Formulas are anything that starts with an equals sign, including totals, percentages and lookups. Labels are the column headings, row names and instructions.

Only inputs should be unlocked. Labels can usually be locked too, so nobody renames a column by mistake. Formulas should always be locked. If you’re unsure whether something is an input, ask whether the person who opens the file would ever need to change it. If the answer is no, lock it.

Common mistakes when deciding what to lock

The most frequent error is locking too much. If every cell is locked, people can’t do their job, and they’ll ask you to remove the protection, which usually means they’ll remove it themselves. The second error is locking too little, usually because someone forgot a column of inputs and then found the sheet refused their entry on the day it mattered.

A third mistake is treating a formula that refers to an input as if it were an input. A total based on a column of typed values is a formula, and it stays locked. The people typing into the column don’t need to touch the total.

How to lock formulas in Excel

Excel is the most common place this question comes up, and the steps are the same in the desktop version of Excel for Windows and Mac, with small differences in menu names. Excel for the web supports sheet protection too, though some options may look different, so check on your own version.

Step by step: unlock input cells, then protect the sheet

Follow these steps in order. Protection comes last, because you can’t unlock cells once the sheet is locked without first removing protection.

  1. Select the cells where people should type. To select several separate areas, hold Ctrl (or Command on a Mac) while you click or drag.
  2. Right-click the selection and choose Format Cells, then open the Protection tab.
  3. Untick Locked and click OK. Those cells are now marked as editable once protection is on.
  4. Go to the Review tab and choose Protect Sheet.
  5. Leave Select locked cells and Select unlocked cells ticked, so people can click on a formula and see it, and can move to the cells they’re meant to fill in.
  6. Decide which actions to allow. Ticking Format cells, Sort or Use AutoFilter lets people do those things. Leave them unticked if you want the layout fixed.
  7. Enter a password if you want one, then confirm it, and click OK.

Test the result before you send anything. Try typing in a formula cell. Excel should show a message saying the cell is on a protected sheet. Then try an input cell, which should accept your entry.

If you add a password, write it down and store it somewhere safe. Excel has no simple way to recover a lost sheet password, and a file you can’t unprotect is a headache later. Remember that the password protects against accidents, so a short, memorable one is often more useful than a complicated one you’ll forget.

Hiding formulas so they don’t show in the formula bar

By default, anyone who clicks a formula cell can see the formula in the formula bar, even when the cell is locked. If you’d rather keep the working out of sight, you can hide it.

Before you protect the sheet, select the formula cells, open Format Cells, go to the Protection tab, tick Hidden, and click OK. Then protect the sheet as normal. The cell still shows its result, but the formula won’t appear in the formula bar.

This is a presentation choice, not a security one. A person can still work out the formula from the result, or unprotect the sheet if they know how.

Protecting the workbook structure

Protecting a sheet stops changes inside it. It doesn’t stop someone from deleting the whole sheet, renaming it, or moving it. If your budget depends on a second sheet holding rates or lookup tables, protect the structure too.

Go to Review, choose Protect Workbook, tick Structure, and add a password if you want one. This stops sheets being added, deleted, renamed or moved. It’s a separate switch from sheet protection, so you may need both.

Seaglass Annual Budget Spreadsheet

Ready-made template

Seaglass Annual Budget Spreadsheet

A year of budgeting in one Excel file: monthly budgets, bill calendar, debt payoff and a dashboard.

See it on Taskdale →

How to lock formulas in Google Sheets

Google Sheets handles protection through permissions rather than a single switch, which makes it more flexible for shared files but also means a few things work differently.

Protecting a range and restricting editors

To protect a set of cells in Google Sheets, select the range you want to lock, such as the formula cells. Then go to Data and choose Protect sheets and ranges. In the panel that opens, add a description if you like, then click Set permissions.

You’ll see two choices. Only you means nobody else can edit the range. Custom lets you list the people who can edit it. Anyone not on the list can still see the cells but can’t change them. The file owner can always edit protected ranges, which is useful if you need to fix something later.

Google also offers Show a warning when editing this range. This lets people change the cells after a prompt, which suits a situation where you want a safety check without a hard block. It’s a good middle path for a family budget where someone occasionally needs to correct a total.

To protect the whole sheet, select the sheet tab instead of a range before you open the menu. Then set permissions for the whole sheet in the same way.

What Google Sheets cannot do

Google Sheets doesn’t have an option to hide formulas. Anyone with access to the sheet can see the formulas in the formula bar, including in protected cells. If your formulas must stay private, Google Sheets alone won’t do it, and you’d need to keep the working in a separate file.

Permissions also matter more than the protection itself. If you share a file with someone as Editor, they can edit any unprotected cell and can also copy the sheet. If you share it as Viewer, they can read it but not change anything. For a file that only a few people should change, sharing as Viewer and keeping a separate editable master is often the simplest arrangement.

A worked example: a shared household budget

Consider a household budget that a retired couple, Ruth and Dennis, share with their daughter, who helps with the paperwork. The sheet has a monthly income figure, eight bill amounts, a total of the bills, and a balance left over. Ruth wants her daughter to update the bill amounts each month, but she doesn’t want the totals or the balance to be typed over.

Here is the layout. Income sits in cell B3, with £2,400 entered. The bill amounts occupy B4 to B10. Cell B12 holds the total with the formula =SUM(B4:B10). Cell B14 holds the balance with =B3-B12. Labels run down column A.

In Excel, Ruth would follow the steps from earlier. She selects B3 to B10 and unticks Locked in Format Cells. She leaves B12 and B14 locked, and she leaves the labels in column A locked. She then chooses Protect Sheet, keeps the two select options ticked, allows Sort only if she wants it, and sets a password she writes into her household notebook.

Next she tests it. She types a new bill amount into B5, which works. She types into B12 and gets the protection message, which tells her the formula is safe. She saves the file as a master copy.

If the same budget lived in Google Sheets, Ruth would select B3 to B10 and choose Protect sheets and ranges, then set the B12 and B14 range to Only you. She could also turn on the warning option for those two cells. If her daughter’s account is on the editor list for B3 to B10, she can type bill amounts without any trouble.

Now suppose Dennis needs to add a ninth bill. Under the locked layout, he can’t insert a row in the middle of the bill list without first removing protection, because the total’s range would need to expand. That’s the right outcome, because it forces a deliberate change. Ruth updates the formula range herself and restores protection afterwards.

The example shows the principle. Only the cells that change each month are open. The totals that depend on them are closed. Anything that changes the structure requires the owner’s hand.

Deciding how much protection your shared file really needs

The right amount of protection depends on what the file is for and who will touch it. A simple rule helps.

If people only enter numbers and the totals are for information, lock the formulas and the labels, unlock the inputs, and set a warning or a light password. This covers most family budgets, club fee lists and small team trackers.

If the file drives a decision with money attached, such as a pension forecast or a payment schedule, keep a master copy that only you edit, share a read-only version with others, and check the results against a second calculation before acting on them.

If the file holds sensitive personal information, sheet protection isn’t enough. Restrict access through the file’s sharing settings, store the file somewhere with proper account controls, and avoid emailing copies that other people can forward.

Lock the formulas, test the protection on a copy, keep a master you control, and share only what people need to see or change. That combination protects your figures from accidents, keeps the working where you can find it, and lets the people you share with get on with their part without needing to understand every formula underneath.

Paidmark Invoice and Estimate Kit

Get the finished file

Paidmark Invoice and Estimate Kit

Invoices, estimates, receipts and a payment tracker that flags what’s overdue, all in one Excel file.

See it on Taskdale →

Scroll to Top