How to Format a Row in Google Sheets if it Contains Some Text
If you have the following Google sheet:
Image for post
Sample Google Sheet
And you want to colorize all rows with names that contain “Meena”, then follow these steps:
- Select the range you want to format
Image for post - Select Conditional Formatting
Image for post - Select Add Another Rule
Image for post - Select “Custom formula is”
Image for post - Pick a formatting style
Image for post
This style will turn my rows green - Add custom formula
=REGEXMATCH($A1, ".Meena([^\n\r])")
Result!
Image for post
Rows colorized automatically using custom conditional formatting that searches for the word “Meena”
How this formula works
In the formula:
=REGEXMATCH($A1, ".Meena([^\n\r])")
We are specifying the following
Match rows that meet the criteria specified by the regular expression
Match cells in column A
Match any cell that contains the word Meena
Feel free to copy-paste this into your conditional formatting rule, but replace $A1 to have the column that contains the text you are matching on, and Meena to have the text you are searching for.
Feel free to check out the sample sheet above here: https://docs.google.com/spreadsheets/d/149yb-gAZcdL6-nIdMz7_uPcWy8xafC8AntDeBpPMzcQ/edit?usp=sharing