In this Exceljet tip, we show you how to highlight entire rows in a list using conditional formatting with a formula. This is a handy way to visually expose information you are interested in without having to apply a filter. We also show you how to move the input for the rule - the content you want to highlight - onto the worksheet where it is much more convenient to work with.
Using conditional formatting, It's easy to highlight cells that match a certain condition. However, it's a little trickier to highlight entire rows in a list that contains multiple columns.
In this video, we'll show you how to use a formula with conditional formatting to highlight an entire row in a multi-column list.
Let's take a look.
Here we have a task list that contains a number of columns - priority, task, owner, and due date.
If we want to highlight all tasks that that are assigned to Bob, we could use the Conditional formatting rule "Text that contains" and then enter "Bob" for the text to match. However this rule only highlights individual cells, and it also catches any cells that just mention Bob.
To highlight rows in the table that contain tasks assigned to Bob, we need to take a different approach.
First, select all of the data in the list. Then, choose New Rule from the conditional format menu on the Home tab of the ribbon.
For style, choose "Classic". Then select "Use a formula to determine which cells to format". The formula needs to test cell values in the Owner column, which is column D, so we enter:
To make sure we are testing only values in column D, we use a dollar sign to lock the column. As the formula is evaluated in each cell of the list, we want the rows to change, so no need to use a dollar sign there.
This formula will return TRUE for each cell in a row where the owner equals "Bob".
To adjust the formatting for a more custom look, just edit the rule and choose Custom Format. Then define a format of your choice.
Like all conditional formats, the formatting is dynamic and will change when cells are updated to contain values matched by the rule.
At this point, your probably thinking "That's pretty cool, but who wants to update a rule to highlight a different name?"
Good point. Let's move the match value out onto the worksheet, where it's more convenient. First, format and label a cell to use for input. Then, adjust the rule formula to use the input cell instead of a hard-coded value.
Now the rule will highlight rows that match the name in the input cell.
In this video, we use conditional formatting to create an interactive search box to highlight data. This is a nice alternative to filtering, because the information you're looking is highlighted in context, and the search box checks multiple...
To highlight entire rows with conditional formatting when a value meets specific criteria, use a formula with a mixed reference that locks the column. In the example shown, all rows where the owner is "bob" are highlighted with the following formula...
Note: Excel contains many built-in "presets" for highlighting values with conditional formatting, including a preset to highlight cells that contain specific text. However, if you want more flexibility, you can use your own formula, as explained in...