To make a rule in Google Sheets, you use a feature called Conditional Formatting. This allows you to automatically change the color of a cell, the text style, or the background based on specific criteria, such as whether a number is above a certain value or if a cell contains a specific word. To start, select your data range, go to Format > Conditional formatting, and define your rule in the sidebar that appears. Note that menu labels may differ slightly depending on your browser version, device, or region.

What You'll Need

  • A Google account with access to Google Sheets.
  • A dataset or a spreadsheet where you want to apply visual rules.
  • A web browser (Chrome, Firefox, Safari, or Edge) on a desktop or laptop computer.

Step-by-Step

  1. Select the Target Range: Open your spreadsheet and highlight the cells you want the rule to apply to. You can click and drag to select a specific block, hold Ctrl (or Cmd on Mac) to select non-adjacent cells, or click the top-left corner square to select the entire sheet.
  2. Open the Formatting Menu: Click on the Format menu in the top toolbar. From the dropdown list, select Conditional formatting. This will open a panel on the right side of your screen.
  3. Define the Range: In the sidebar, check the "Apply to range" box. If you already selected your cells, this will be filled in automatically. If not, you can manually type the range (e.g., A1:B20) or click the grid icon to select the range with your mouse.
  4. Set the Format Rule: Under the "Format rules" section, click the dropdown menu labeled "Format cells if..." Here, you will choose the logic for your rule. Common options include:
    • Text contains: Highlights cells that include a specific word or phrase.
    • Text starts with/ends with: Useful for identifying IDs or categories.
    • Greater than / Less than: Ideal for budget tracking or grading.
    • Date is: Highlights dates that are today, tomorrow, or within a specific range.
    • Is empty / Is not empty: Helps find missing data in a large sheet.
    • Custom formula is: Allows you to write a complex logical statement to format a cell based on the value of a different cell.
  5. Enter the Value: Once you select a rule (like "Greater than"), a new box will appear below it. Enter the number, text, or date that triggers the rule. For example, if you want to highlight all sales over $500, type "500" in this box.
  6. Choose the Formatting Style: Under the "Formatting style" section, decide how the cell should look when the rule is met. You can change the fill color (the background), the text color, make the text bold, italicize it, or strike it through. Click the paint bucket icon to choose a specific color.
  7. Save the Rule: Click Done at the bottom of the sidebar. Your cells will now automatically change color whenever the data meets the criteria you set.

Common Mistakes

One of the most frequent errors is selecting the wrong range. If you apply a rule to column A but your data is in column B, the rule will never trigger. Always double-check the "Apply to range" field in the sidebar before clicking Done.

Another common mistake is creating overlapping rules. Google Sheets processes conditional formatting rules in order from top to bottom. If you have one rule that turns a cell red if it is greater than 10, and another rule that turns it green if it is greater than 50, a cell with the value 60 will turn red because it satisfies the first rule first. To fix this, you must drag the more specific rule (the "greater than 50" rule) to the top of the list in the sidebar.

Users also often confuse "Text contains" with "Text is exactly." If you use "Text contains" and type "App," the rule will trigger for "Apple," "Application," and "Pineapple." If you only want "Apple," you must use the "Text is exactly" option.

Finally, avoid applying too many complex rules to a massive dataset (thousands of rows). While Google Sheets is powerful, having dozens of conditional formatting rules running simultaneously across a huge sheet can cause the browser to lag or the spreadsheet to slow down during data entry.

Tips

To create a "Heat Map" effect, use the Color scale tab at the top of the Conditional Formatting sidebar instead of the "Single color" tab. This allows you to set a minimum and maximum value, and Google Sheets will automatically apply a gradient of colors (e.g., from red to green) based on where the value falls in that range.

If you need to format an entire row based on the value of a single cell, you must use a Custom formula. For example, if you want the whole row to turn green when column C says "Complete," you would select the whole data range and use the formula =$C1="Complete". The dollar sign before the C is critical; it locks the rule to column C while allowing the row number to change as the rule moves down the sheet.

You can quickly manage your rules by clicking any cell that has formatting applied and returning to Format > Conditional formatting. This brings up the list of all active rules for that range, allowing you to edit them or delete them by clicking the trash can icon next to the rule.

Troubleshooting

If your rule is not working, first check for hidden characters. A cell that looks like it contains "100" might actually contain "100 " (with a trailing space). Google Sheets treats this as text, not a number, so a "Greater than" rule will fail. Use the =TRIM() function to clean your data if this is happening.

If the colors are not appearing, check if there is a manual fill color applied to the cells. While conditional formatting usually overrides manual formatting, certain complex layering or protected sheets can cause display issues. Try clearing the formatting of the cells (Format > Clear formatting) and then reapplying the rule.

If you are using a custom formula and the highlighting is shifted (e.g., the rule triggers one row below where it should), check your range and your formula. If your range starts at A2, your formula must refer to row 2 (e.g., =$C2="Yes"). If the formula refers to A1 but the range starts at A2, the formatting will be offset by one row.

If the sidebar does not appear, ensure you are using a desktop browser. The mobile app version of Google Sheets has very limited conditional formatting capabilities compared to the desktop version; some advanced rules and custom formulas can only be created on a computer.

Frequently Asked Questions

Can I have more than one rule for the same cell?

Yes, you can add multiple rules to the same range. Google Sheets will apply them in the order they appear in the sidebar. The rule at the top takes priority.

How do I remove a rule I created?

Go to Format > Conditional formatting to open the sidebar. Hover over the rule you want to remove and click the trash can icon that appears to the right of the rule.

Can I use conditional formatting to highlight duplicates?

Yes, but you must use a custom formula. For a range like A1:A100, you would use =COUNTIF($A$1:$A$100, A1)>1 to highlight any value that appears more than once.

Does conditional formatting work on mobile devices?

You can see the results of rules on mobile, and you can create basic rules in the app, but complex rules and custom formulas are best managed on the desktop version.

Can I format a cell based on the value of another cell?

Yes, this is done using the "Custom formula is" option. By using an absolute reference (the $ sign) for the column, you can tell the sheet to look at a specific cell to determine the formatting of another.

Will conditional formatting slow down my sheet?

In most cases, no. However, if you have hundreds of rules applied to tens of thousands of cells, you may notice a delay in how quickly the sheet updates when you enter new data.