HomeGoogle DocsSpreadsheetHow to Highlight Cells Containing a Specific Function in Google Sheets

How to Highlight Cells Containing a Specific Function in Google Sheets

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.

If you want to explore more conditional formatting techniques—such as lookups, duplicates, ranking, and advanced formula-based rules—check out: The Ultimate Guide to Conditional Formatting in Google Sheets

You May Also Like:

Prashanth K V
Prashanth K V
Your Trusted Google Sheets and Excel Expert Prashanth K V is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

How to Build a Dynamic Nonogram Clue Generator in Google Sheets

Over the past few months, I've built a couple of games in Google Sheets,...

Carpool Cost Splitter & Rotation Tracker in Google Sheets (Free Template)

Managing a carpool can be difficult, especially when you need to track whose vehicle...

How to Build a Road Trip Fuel Cost Splitter Formula in Google Sheets

Need a fair formula to split fuel costs among travelers on a long road...

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.