Google Sheets Conditional Formatting Formula Guide

How-to basics · Updated November 23, 2026

The core formula for conditional formatting in Google Sheets is entered in the Custom formula is field within Format > Conditional formatting. For example, to highlight cells in column A that are greater than 100, select the range A1:A100, open the conditional formatting panel, choose “Custom formula is,” and enter =A1>100. This formula is evaluated for the top-left cell of the selected range, and relative references adjust for each cell.

What Is Conditional Formatting?

Conditional formatting automatically changes a cell’s background color, text color, or formatting based on a rule you set. It’s a built-in feature in Google Sheets that helps you visually spot trends, outliers, or specific values without manually scanning rows of data. Rules can be simple (e.g., “highlight cells greater than 100”) or complex (e.g., “highlight entire rows where a checkbox is ticked and the date is within 7 days”). The feature is part of Google Sheets, so it works entirely in your browser and requires no add-ons.

How to Open the Conditional Formatting Panel

In Google Sheets (web browser):

  1. Select the range of cells you want to format (e.g., A1:C50).
  2. Click Format in the top menu, then Conditional formatting.
  3. In the panel that opens on the right, under “Format cells if,” choose Custom formula is from the dropdown.
  4. Enter your formula in the text box that appears.
  5. Set the formatting style (e.g., fill color, bold) and click Done.

On the Google Sheets mobile app (Android/iOS), the path is slightly different: tap the range, then tap Format (the paint roller icon) and choose Conditional formatting. The formula input works the same way.

How the Custom Formula Works

When you enter a custom formula, Google Sheets treats it as a logical test. The formula must return TRUE for a cell to be formatted. The key is that the formula is written relative to the top-left cell of the selected range. For example, if your range is A1:C10, the formula =A1>100 is evaluated for each cell by shifting the reference: for cell B2, it becomes =B2>100. This relative referencing is what makes the rules dynamic.

You can use any formula that returns a boolean (TRUE/FALSE), including functions like AND, OR, NOT, ISBLANK, ISNUMBER, and even VLOOKUP or MATCH. For example, to highlight cells in column A that are greater than 100 and column B is “Yes”, use =AND(A1>100, B1="Yes").

Choosing the Right Formula for Common Tasks

Here are several practical examples with the formulas you’d enter (assuming the range starts at A1):

  • Highlight duplicates in a column (A1:A100): =COUNTIF($A$1:$A$100, A1)>1 — the dollar signs lock the range so each cell is compared against the whole column.
  • Highlight an entire row when a checkbox is checked (range A1:E100): =$A1=TRUE — the dollar sign before A locks the column, so the rule applies to all columns in the row.
  • Highlight dates within the next 7 days (range A1:A100): =AND(A1>=TODAY(), A1<=TODAY()+7)
  • Highlight cells that contain the word “urgent” (range A1:A100): =REGEXMATCH(A1, "urgent") — note that this is case-sensitive; use (?i) for case-insensitive, e.g., =REGEXMATCH(A1, "(?i)urgent").
  • Highlight blank cells (range A1:A100): =ISBLANK(A1)

Always test your formula on a small range first. If it returns an error (like #N/A), the rule won’t apply, and you’ll see no formatting.

Common Mistakes and Troubleshooting

One frequent error is forgetting the equals sign — Google Sheets requires it for formulas. Another is using absolute references incorrectly. If you want the rule to apply to each row independently, use relative references (no dollar signs). If you want to lock a column or row, use dollar signs as shown above.

Another issue: formulas that return a value other than TRUE/FALSE. For example, =A1>100 returns TRUE or FALSE, but =A1+100 returns a number, which won’t work. If your formula returns a number, wrap it in a logical test, like =IF(A1+100>0, TRUE, FALSE) — though that’s redundant; just use =A1+100>0.

If multiple rules overlap, the first rule in the list takes precedence (unless you check “Stop if true”). To reorder rules, drag them in the panel.

Conditional Formatting vs. Excel

Google Sheets and Microsoft Excel both have conditional formatting, but the interface differs. In Excel, you use Home > Conditional Formatting > New Rule, and the formula uses the same relative referencing concept. However, Excel’s formula syntax is identical (both use = and commas). One key difference: in Google Sheets, you can use REGEXMATCH for regex, while Excel uses ISNUMBER(SEARCH(...)) or FIND. Also, Google Sheets’ custom formula field is directly in the panel; Excel requires a dialog box. For most basic rules, the logic transfers seamlessly.

Performance and Limitations

Conditional formatting formulas are recalculated whenever the sheet changes. For very large sheets (tens of thousands of rows), complex formulas like VLOOKUP inside conditional formatting can slow down performance. To mitigate, avoid using volatile functions like NOW() or RAND() in rules, and try to limit the range to only the cells that need formatting. Google Sheets also has a limit: you can have up to 20 conditional formatting rules per sheet (as of 2025). If you exceed that, you’ll need to combine rules using OR or restructure your sheet.

Frequently Asked Questions

Why isn’t my conditional formatting formula working?

Check that you’ve selected “Custom formula is” and that your formula starts with =. Also verify that the range you selected matches the formula’s relative references. For example, if you selected A2:A100, your formula should reference A2, not A1. If you’re using a function like VLOOKUP, ensure it returns TRUE or FALSE — wrap it with ISNUMBER if needed.

Can I use conditional formatting to highlight a whole row based on one cell?

Yes. Select the entire row range (e.g., A1:E100) and use a formula that locks the column of the cell you’re checking. For instance, =$A1="Paid" will highlight the whole row when column A says “Paid”. The dollar sign before A locks the column, while the row number adjusts for each row.

How do I highlight duplicates in Google Sheets?

Use the formula =COUNTIF($A$1:$A$100, A1)>1 on range A1:A100. This counts how many times each cell’s value appears in the entire column; if more than once, it highlights. For multiple columns, adjust the range accordingly.

Does conditional formatting work on the mobile app?

Yes, but the interface is more limited. You can create and edit rules in the Google Sheets app by selecting a range, tapping the paint roller icon, then “Conditional formatting.” However, some advanced functions (like custom formulas) are available, but the panel is smaller. It’s often easier to edit on a computer.

Can I copy conditional formatting to another range?

Yes. Use the Paint format tool (the roller icon in the toolbar). Select the cell with the formatting, click the paint roller, then click/drag over the target range. This copies all formatting, including conditional formatting rules, but note that the rules’ ranges will adjust relative to the new location.

How do I remove conditional formatting?

Select the range, open Format > Conditional formatting, and you’ll see the list of rules. Hover over a rule and click the trash icon to delete it, or click “Remove all rules” at the bottom of the panel to clear all formatting from the selected range.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.