How to Highlight Cells Containing a Specific Function in Google Sheets

Published on

If you have many formulas spread across a sheet in Google Sheets, it’s easy to highlight all formula cells using the ISFORMULA function.

But what if you want to highlight only cells that contain a specific function — like VLOOKUP, SUMIF, or formulas using addition, subtraction, or division?

In this tutorial, I’ll show you exactly how to highlight specific functions or operators in Google Sheets using Conditional Formatting and REGEX formulas.

Highlight All Formula Cells in Google Sheets

Quick tip:

You can highlight all formula cells by using a custom formula with ISFORMULA.

Select the range A1:Z (or the entire sheet starting from A1). Then, in Format > Conditional formatting > Format rules > Custom formula, enter:

=ISFORMULA(A1)

This highlights all cells containing any formula.

But now let’s focus on highlighting only specific functions or operators.

How to Highlight Cells Containing a Specific Operator

Formulas often involve basic math operators like +, -, /, and *. We can highlight cells containing a certain operator by using the FORMULATEXT function with REGEXMATCH.

For example, suppose your sheet has addition formulas like:

  • =A1+B1+C1
  • =5+10+15

Here’s how to highlight only those cells:

Step 1: Select your range (e.g., A1:I5).

Click and drag to select the cells you want to apply the conditional formatting to. You can also click the first cell (A1), hold down Shift, and then click the last cell (I5) to quickly select the entire range.

Step 2: Use this custom formula in Conditional Formatting:

=REGEXMATCH(FORMULATEXT(A1), "\+")

This will highlight only cells containing the plus (+) operator.

Example of highlighting cells containing operator-based formulas in Google Sheets

Why it Works

  • FORMULATEXT(A1) converts the formula to text.
  • REGEXMATCH looks for the + symbol inside the formula text.

Important:

If a cell doesn’t contain a formula (e.g., just text like “Mango+Orange”), FORMULATEXT returns #N/A, and such cells are ignored.

Highlight Cells with Subtraction, Division, or Multiple Operators

You can modify the regex to highlight different operators:

  • Subtraction (-)
    =REGEXMATCH(FORMULATEXT(A1), "\-")
  • Division (/)
    =REGEXMATCH(FORMULATEXT(A1), "\/")
  • Both Addition and Subtraction
    =REGEXMATCH(FORMULATEXT(A1), "\-|\+")

This flexibility lets you target formulas using multiple operations!

How to Highlight Cells Containing a Specific Function Like SUMIF or VLOOKUP

Suppose you want to highlight cells using the SUMIF function.

Here’s the Conditional Formatting formula:

=REGEXMATCH(FORMULATEXT(A1), "(?i)SUMIF")
  • (?i) makes the match case-insensitive, so it works even if you type sumif, SUMIF, or SumIf.
Example of highlighting cells containing the SUMIF function in Google Sheets

Similarly, to highlight cells containing the VLOOKUP function:

=REGEXMATCH(FORMULATEXT(A1), "(?i)VLOOKUP")

Replace the function name in the formula (e.g., “SUMIF”, “VLOOKUP”) with any function you want to highlight.

Real-World Example Table

Formula ExampleWhat It Contains
=A1+B1+C1Addition Operator
=SUMIF(A2:A10, ">10", B2:B10)SUMIF Function
=VLOOKUP(E2, A2:C10, 2, FALSE)VLOOKUP Function

Apply the appropriate custom formula to highlight the matching cells!

Bonus Tip: Combine Multiple Functions

Want to highlight cells containing either SUMIF or VLOOKUP?

Use a regex that matches both:

=REGEXMATCH(FORMULATEXT(A1), "(?i)SUMIF|VLOOKUP")

This will highlight cells containing either function.

Conclusion

Using FORMULATEXT and REGEXMATCH, you can precisely highlight cells that contain a specific function or operator in Google Sheets.

Whether you want to catch SUMIF, VLOOKUP, addition, or subtraction formulas — you now know the exact steps to do it easily!

You May Also Like:

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

Top N Products and Top N Sellers in Google Sheets (Top N of Top N)

If you’ve ever wanted to compare which sellers contribute the most to your top-selling...

Use XLOOKUP in a Structured Table in Google Sheets (Single and Multiple Conditions)

This tutorial is for users who want to apply XLOOKUP inside a structured table...

Reset SCAN by Another Column in Google Sheets and Excel

Resetting SCAN function results based on values in another column is a topic of...

More like this

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

Top N Products and Top N Sellers in Google Sheets (Top N of Top N)

If you’ve ever wanted to compare which sellers contribute the most to your top-selling...

Use XLOOKUP in a Structured Table in Google Sheets (Single and Multiple Conditions)

This tutorial is for users who want to apply XLOOKUP inside a structured table...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.