Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to do a t-Test in Excel?
  • Conditional Formatting Color Scales Examples in Excel
  • How To Perform and Interpret Regression Analysis in Excel
  • How to Create Thermometer Chart in Excel
  • How to calculate average last N values in a table in Excel

References

  • Two-way lookup with VLOOKUP in Excel
  • Count rows that contain specific values in Excel
  • How to use Excel FORMULATEXT function
  • How to get address of first cell in range in Excel
  • How to retrieve first match between two ranges in Excel

Data Validations

  • How To Create Drop-down List in Excel
  • Excel Data validation require unique number
  • Excel Data validation whole percentage only
  • Excel Data validation must not contain
  • Excel Data validation date in next 30 days

Highlight rows that contain in Excel

by

This tutorial shows how to Highlight rows that contain in Excel using the example below;

Formula

=SEARCH(text,cocatenated_columns)

Explanation

If you want to highlight rows in a table that contain specific text, you use conditional formatting with a formula that returns TRUE when the the text is found. The trick is to concatenate (glue together) the columns you want to search and to lock the column references so that only the rows can change.

For example, assume you have a simple table of data in B4:E11 and you want to highlight all rows that contain the text “dog”. Just select all data in the table and create a new conditional formatting rule that uses this formula:

=SEARCH("dog",$B4&$C4&$D4&$E4)

Note: with conditional formatting, it’s important that the formula be entered relative to the “active cell” in the selection, which is assumed to be B4 in this case.

Worked Example:   How to count keywords in a range of cell

How this formula works

The SEARCH function returns the position of the text you are looking for as a number (if it exists). Conditional formatting automatically treats any positive number as TRUE, so the rule is triggered whenever search returns a number. When SEARCH doesn’t find the text you’re looking for, it returns a #VALUE error, which conditional formatting treats as FALSE.

Worked Example:   Highlight dates that are weekends in Excel

Using the ampersand (&) we are concatenating all values in each row together and then searching the result with SEARCH. All addresses are entered in “mixed” format, with the columns locked and the rows left relative. Effectively, this means that all 4 cells in each row are tested with exactly the same formula.

Using other cells as inputs

Note that you don’t have to hard-code any values that might change into the rule. Instead you can use another cell as an “input” cell so you can easily change it later. For example, in this case, you could name cell E2 “input” and rewrite the formula like so

=SEARCH(input,$B4&$C4&$D4&$E4)

You can then put any text value in E2, and the conditional formatting rule will respond instantly, highlighting rows that contain that text. See the video link below for a more detailed description.

Worked Example:   Split dimensions into three parts in Excel

Case sensitive option

If you need a case-sensitive option, you can use the FIND function instead of SEARCH like so:

=FIND(input,$B4&$C4&$D4&$E4)

The FIND function works just like SEARCH, but matches case as well.

Post navigation

Previous Post:

VLOOKUP without #N/A error in Excel

Next Post:

How to Create Gantt Chart in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • SWITCH function example in Excel
  • OR function Examples in Excel
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • FALSE function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Get first day of month in Excel
  • Roll back weekday to Friday base on a particular date in Excel
  • Get day from date in Excel
  • Get month name from date in Excel
  • Add months to date in Excel

Grouping

  • Group numbers at uneven intervals in Excel
  • Running count group by n size in Excel
  • Group numbers with VLOOKUP in Excel
  • Map inputs to arbitrary values in Excel
  • Group arbitrary text values in Excel

General

  • AutoRecover file that was never saved in Excel
  • Share Excel data with Word documents
  • Check if multiple cells have same value in Excel
  • 3D SUMIF for multiple worksheets in Excel
  • Currency vs Accounting Format in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning