Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Lock Formulas in Google Sheets (3 Easy Ways)

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Locking formulas in Google Sheets protects your calculations from accidental edits, deletions, or overwrites by other collaborators. This guide shows you three practical methods: protecting a range, hiding formulas while protecting them, and using data validation for cell-level control. You'll need a Google account and a sheet with formulas you want to secure.

What You'll Need

  • A Google account (free)
  • A Google Sheets document with formulas you want to lock
  • Edit access to the sheet (you must be the owner or an editor)

Step-by-Step

Method 1: Protect a Range (Simplest)

  1. Open your Google Sheets document.
  2. Select the cells that contain the formulas you want to lock. You can click and drag, or hold Ctrl (Windows) or Cmd (Mac) to select multiple non-adjacent ranges.
  3. Right-click on the selected cells and choose Protect range from the context menu. Alternatively, go to Data > Protect sheets and ranges.
  4. In the sidebar that opens on the right, click Add a sheet or range.
  5. Give the protected range a name (e.g., "Formulas") so you can manage it later.
  6. Click Set permissions.
  7. Choose Restrict who can edit this range.
  8. Select Only you to lock it for everyone except yourself. To allow specific collaborators to edit, choose Custom and enter their email addresses.
  9. Click Done or Back to apply.
  10. Now, anyone else who tries to edit those cells will see a warning and be blocked unless they request access.

Method 2: Hide Formulas While Protecting (Advanced)

This method hides the formula bar content for selected cells, so collaborators can see the result but not the underlying formula.

  1. Select the cells with formulas you want to hide.
  2. Go to Format > Number > Custom number format.
  3. In the field, type three semicolons: ;;; (without spaces). This is a custom format that displays nothing.
  4. Click Apply. The cell values will appear blank, but the formulas still work.
  5. Now, protect the range as in Method 1. This prevents anyone from selecting the cell and seeing the formula in the formula bar (since the cell appears empty, they won't know to look).
  6. To unhide later, apply the default format (e.g., Automatic or Number) to those cells.

Method 3: Use Data Validation for Input Cells (Prevent Overwrite)

If your formulas are in a column next to input cells, you can lock the input cells to prevent users from typing over them—which indirectly protects the formulas from being overwritten by accidental keystrokes.

  1. Select the cells where users should NOT enter data (the formula cells).
  2. Go to Data > Data validation.
  3. Under Criteria, choose Custom formula is.
  4. Enter a formula that always evaluates to false, e.g., =FALSE().
  5. Check Show validation help text and enter a message like "This cell is protected."
  6. Click Save. Now, if someone tries to type in that cell, they'll see a warning and the entry will be rejected.
  7. Note: This method is less secure than range protection because a determined user can bypass it. Use it as a gentle nudge, not a hard lock.

Common Mistakes

  • Not setting permissions correctly: If you choose "Only you" but you're logged into a different Google account, you'll lock yourself out. Double-check the account you're using.
  • Protecting the wrong range: Selecting the entire column instead of just the formula cells can block legitimate data entry elsewhere.
  • Forgetting to protect hidden formula cells: If you use the custom format trick (Method 2) but don't protect the range, anyone can still select the cell and see the formula in the formula bar.
  • Using data validation as a security measure: It's a warning, not a lock. Users can ignore it or clear validation.
  • Not notifying collaborators: If you lock a range without telling your team, they may think the sheet is broken when they can't edit.

Tips

  • Use named ranges: When protecting, give the range a clear name like "Formulas_Total" so you can manage it easily in the sidebar.
  • Combine methods: Use range protection (Method 1) for hard security, and the custom format (Method 2) to hide formulas from prying eyes.
  • Test as another user: After locking, open the sheet in an incognito window (or with a different account) to verify the lock works as intended.
  • Document your locks: Add a note in a cell or a separate tab explaining which ranges are protected and why.
  • Keep a backup: Before locking, duplicate the sheet (Right-click tab > Duplicate) so you have an editable copy in case you need to change formulas later.

Troubleshooting

I can't edit my own formulas after protecting

You likely protected the range with "Only you" but are logged into a different Google account. Check the top-right corner of Sheets to confirm the account. If it's wrong, switch accounts. If you're the owner, you can always go to Data > Protect sheets and ranges and change permissions or remove the protection.

Collaborators can still edit despite protection

This usually happens when the range protection is set to "Show a warning" instead of "Restrict who can edit." Go to the protection settings and change it to Restrict. Also, ensure you've clicked Set permissions and saved.

The custom format trick isn't hiding formulas

Make sure you typed exactly three semicolons ;;; with no spaces. If you see a number or text, the format wasn't applied. Also, the formula bar will still show the formula if the cell is selected—protection is required to prevent selection.

Data validation isn't blocking input

Data validation only shows a warning by default. To make it reject input, uncheck Show validation help text and check Reject input (if available). However, this still isn't a true lock—users can clear validation. Use range protection for real security.

Frequently Asked Questions

Can I lock formulas without protecting the entire sheet?

Yes. Use Data > Protect sheets and ranges and select only the cells with formulas. You can protect a single cell, a range, or multiple ranges at once.

Will locking formulas affect new rows I add?

No. Protection applies only to the specific range you selected. If you add new rows with formulas, they won't be protected unless you extend the protected range or set up a new one.

Can I lock formulas in Google Sheets on mobile?

Yes, but the process is slightly different. In the Google Sheets app, tap the range, then tap the three-dot menu and choose Protect range. The options are similar to the desktop version.

How do I unlock a protected range?

Go to Data > Protect sheets and ranges. In the sidebar, click the protected range, then click the trash icon to delete it, or click Edit to change permissions.

Can I hide formulas from the formula bar without locking the cell?

Yes, use the custom number format ;;; to hide the display, but the formula will still appear in the formula bar when the cell is selected. To hide it from the formula bar, you must also protect the cell so it can't be selected.

Is there a way to lock formulas so that even I can't edit them?

No, as the owner you always have the ability to remove protection. But you can set permissions to "Only you" and then log out—though you'll need to log back in to edit. There's no true uneditable lock for the owner.