Conditional Formatting in Google Sheets: Apply Text from List

Streamlining your Google Sheets workflow often involves automating repetitive tasks, and conditional formatting is a powerful tool for this. One common use case is applying formatting based on whether a cell contains text from a predefined list. Let's delve into how to achieve this with step-by-step instructions and best practices.

Google Sheets - Conditional Formatting Based on Another Cell
Google Sheets - Conditional Formatting Based on Another Cell

Before we dive in, ensure you're familiar with conditional formatting in Google Sheets. If not, we recommend checking out our beginner's guide to get started.

How to Use Conditional Formatting in Google Sheets
How to Use Conditional Formatting in Google Sheets

Setting Up Your List and Data

First, create a list of texts you want to check for in a separate sheet or range. This list will serve as your reference. For instance, if you're tracking project status, your list might include "In Progress", "Completed", "On Hold", etc.

Excel Conditional Formatting If a Cell Contains Any Text
Excel Conditional Formatting If a Cell Contains Any Text

Next, in the main sheet where you want to apply conditional formatting, ensure the data is in the same format as your list. For example, if your list has text in all caps, make sure your data is also in all caps to avoid mismatches.

Using Regular Expressions (RegEx)

Excel Conditional Formatting Based on Another Cell Tutorial
Excel Conditional Formatting Based on Another Cell Tutorial

Google Sheets uses regular expressions to match patterns in text. To check if a cell contains text from your list, you'll need to create a regular expression that matches any of the items in your list.

Here's how to create a RegEx pattern for our project status example: - Start with an opening square bracket: [ - Followed by a pipe (|) to separate each item in your list. For example, In Progress|Completed|On Hold - End with a closing square bracket: ]

Applying Conditional Formatting

How to Use Slicers in Google Sheets
How to Use Slicers in Google Sheets

Now that you have your RegEx pattern, follow these steps to apply conditional formatting:

  1. Select the range of cells you want to format.
  2. Click on "Format" in the menu, then "Conditional formatting".
  3. Under the 'Format cells if...' dropdown, choose 'Custom formula is'.
  4. Enter your regular expression pattern (e.g., =regexmatch(A1, "In Progress|Completed|On Hold")), replacing "A1" with the first cell in your range and the pattern with your RegEx.
  5. Choose the formatting style you want to apply (e.g., fill color, text color, etc.).
  6. Click 'Done'.

Advanced Techniques and Best Practices

How to Copy Conditional Formatting to Another Cell in Excel
How to Copy Conditional Formatting to Another Cell in Excel

Now that you've mastered the basics, let's explore some advanced techniques and best practices:

Using Named Ranges

How to Use Conditional Formatting in Google Sheets
How to Use Conditional Formatting in Google Sheets
Google Sheets Formula Cheat Sheet
Google Sheets Formula Cheat Sheet
Essential Google Sheets Text and Web Formulas for Productivity
Essential Google Sheets Text and Web Formulas for Productivity
Change Cell Colour using Conditional Formatting
Change Cell Colour using Conditional Formatting
Google Sheets: Construct Formulas with the INDIRECT Function - Teacher Tech with Alice Keeler
Google Sheets: Construct Formulas with the INDIRECT Function - Teacher Tech with Alice Keeler
How to Format Cells in Excel Like a Pro: Step-by-Step Guide
How to Format Cells in Excel Like a Pro: Step-by-Step Guide
Excel Conditional Formatting
Excel Conditional Formatting
Google Sheets For Beginners - Lock Top Row
Google Sheets For Beginners - Lock Top Row
the spreadsheet is open and ready to be used for project management, as well as other tasks
the spreadsheet is open and ready to be used for project management, as well as other tasks
50 Google Sheets Shortcuts Every User Must Know
50 Google Sheets Shortcuts Every User Must Know
How to Wrap Text in Excel and Google Sheets
How to Wrap Text in Excel and Google Sheets
All the ways to extract text or numbers from a string in Google Sheets
All the ways to extract text or numbers from a string in Google Sheets
How to Use COUNTIF on Google Sheets, Infographic
How to Use COUNTIF on Google Sheets, Infographic
4 Ways to Add Alternating Colors in Google Sheets
4 Ways to Add Alternating Colors in Google Sheets
Google Sheets Activities
Google Sheets Activities
Calender in Excel ‼️ Amazing Excel trick using data validation and conditional formatting ✅ #Excel
Calender in Excel ‼️ Amazing Excel trick using data validation and conditional formatting ✅ #Excel
5 Handy Excel Tricks for Conditional Formatting Every Analyst Should Know
5 Handy Excel Tricks for Conditional Formatting Every Analyst Should Know
Checkbox Hacks in Google Sheets! Easily add conditional formatting when a checkbox is checked + more
Checkbox Hacks in Google Sheets! Easily add conditional formatting when a checkbox is checked + more
Advanced Excel
Advanced Excel
Format Cells Fast in Excel with Ctrl + 1
Format Cells Fast in Excel with Ctrl + 1

If your list is in a separate sheet or range, consider using named ranges for easier reference and better organization. To create a named range, select your list, click on "Insert" in the menu, then "Named range". Give it a descriptive name and click 'Done'.

Combining Conditions

You can combine conditions to create more complex rules. For example, you might want to apply formatting only if the cell contains text from your list AND the cell is not empty. To do this, use the AND operator in your formula (e.g., =AND(regexmatch(A1, "In Progress|Completed|On Hold"), A1<>"") ).

By mastering conditional formatting with text lists in Google Sheets, you can automate visual cues that help you and your team stay organized and productive. Happy formatting!