30 Advanced Excel Tips for 2026

Excel Champs / Excel Basics / Highlight Rows
By Puneet Gogia (Microsoft MVP)

Highlight Rows using Conditional Formatting in Excel

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

Select the data from its first data row across every column (for example A2:D11), then go to Home → Conditional Formatting → New Rule → Use a formula to determine which cells to format. Enter =$B2="Sofas", click Format, choose a fill colour and click OK twice. Every row with Sofas in column B is highlighted across all its columns.

The $ before the column letter is what colours the whole row. $B2 locks the test to column B while the row number moves down with each row. Write the formula for the top row of your selection: if the selection starts in row 5, use $B5.

Swap the test to suit the data: =$D2>=25 for a number, =ISNUMBER(SEARCH("HS-",$B2)) when the cell only contains the text (SEARCH ignores case), =AND($D2>=25,$C2>=15) when every condition must be met, =OR($D2>=25,$C2>=15) when any one is enough, and =COUNTBLANK($A2:$D2)>0 for rows with an empty cell.

To pick the value from a drop-down instead of editing the rule, create a list in a cell such as F1 with Data → Data Validation → Allow: List, then use =$B2=$F$1 as the rule. Changing the drop-down re-colours the matching rows.

If only one column changes colour, the $ is missing. If the highlight lands one row off, the row in the formula does not match the top row of the selection. Check Conditional Formatting → Manage Rules to see the Applies to range, and type the quote marks yourself: curly quotes copied from a web page make Excel reject the formula.

In Excel, by using conditional formatting, you can highlight the entire row. When a condition is true, the row gets highlighted with the specified color. For example, below, we have a table with the stock data.

highlight-rows-using-conditional-formatting

1. Highlight a Row Based on a Value (Text)

  1. Select the entire table, all the rows and columns.
    2-select-all-rows-and-columns
  2. Go to Conditional Formatting > New Rule.
    3-conditional-formatting-new-rule
  3. In the new rule dialog box, click “Use a formula to determine which cell to format…”.
    4-select-use-a-formaula-to-determine
  4. In the “Format values where this formula is true”, enter the formula =$B2=”Sofas”.
    5-enter-formula-in-format-values
  5. After that, click the Format button to specify the color you want to apply to the rows.
    6-click-format-button
  6. In the end, click OK, and then again OK to apply the conditional formatting.

When you click OK, it will highlight the rows where the product name is “Sofas”.

The $ before B is what makes the whole row change color: every cell in the row checks column B. And there’s no $ before the 2, so the next row checks B3, then B4, and so on. Make sure the row number in the formula is the first row of your selection.

highlight-the-rows

2. Highlight a Row Based on a Value (Partial Text)

And if you want to write a formula to check for a partial text, use the SEARCH function. In the below example, we need to highlight all the rows where you have “HS-” in the product column.

=ISNUMBER(SEARCH("HS-",$B2))

SEARCH returns the position of “HS-” when it finds it, and ISNUMBER turns that into TRUE. SEARCH isn’t case-sensitive, so “hs-” matches too; use FIND instead of SEARCH if the case matters.

highlight-row-based-on-partial-text

And the moment you click OK, it highlights all the rows where there’s the partial text “HS-“.

highlight-all-rows-with-partial-text

3. Highlight a Row Based on a Value (Number)

Now let’s say you want to highlight the rows where the aging days are 25 days or more. In this case, you need to use the same steps we have used above. But the formula needs to be different.

highlight-rows-based-on-numbers

You need to use the formula =$D2>=25. This formula checks if the cell’s value is greater than or equal to 25. And if it is, it highlights the entire row in the table.

highlight-all-rows-with-given-reference-number

4. Highlight Rows Based on Multiple Conditions

You can also create a formula to test multiple conditions. You can use the AND and OR functions in the formula.

=AND($D2>=25,$C2>=15)
highlight-rows-based-on-multiple-conditions

When you enter this formula in the new rule dialog box, it highlights rows based on two conditions:

  • Days Aging needs to be greater than or equal to 25.
  • Quantity needs to be greater than or equal to 15.

That’s why, in the formula, we have used AND, which helps you test two or more conditions simultaneously and returns TRUE only when both conditions are TRUE.

And if you want to highlight the row when any one of the conditions is true, use OR instead:

=OR($D2>=25,$C2>=15)

5. Highlight the Row IF Any Cell Is Blank

Let’s say you want to create a condition that if any of the cells in a row is blank, the entire row gets highlighted with a color you define.

Select the data and then go to the Home Tab > Conditional Formatting > New Rule > Use a formula to determine which cells to format; enter the formula =COUNTIF($A2:$D2,””)>0 and then click on the Format button to specify the formatting.

highlight-row-if-any-cell-is-blank

And once you click OK, it will highlight all the rows where even a single cell is blank.

highlighted-rows-with-a-blank-cell

6. Highlight Rows with a Dynamic Value from a Drop-Down

You can also create a drop-down from which you can select the value, and the conditional formatting will use that value to highlight the rows. So, first, create a drop-down list in cell F1. For this, go to the Data Tab > Data Validation.

highlight-rows-with-dynamic-value

In the data validation dialog box, select List from the “Allow” drop-down and enter the following formula in Source:

=OFFSET($B$2, 0, 0, COUNTA($B$2:$B$11), 1)
data-validation-dialog-box

Finally, click OK for a drop-down list with the product names. If a product appears in more than one row, it also appears more than once in this list.

drop-down-list

After that, select the data and open the conditional formatting’s New Rule dialog box. Next, click “Use a formula to determine which cells to format”, and then enter the following formula in “Format values where this formula is true”:

=$B2=$F$1

And make sure to click on the Format button to specify the color you want to use to highlight the row.

format-button-to-specify-color

In the end, click OK to apply the rule. And when you change the value in the drop-down, it highlights the rows based on that value. So this conditional formatting rule uses the value from the drop-down in cell F1.

rows-highlighted-based-on-drop-down-values

Why the Whole Row Is Not Highlighted

  • Missing $ before the column: with =B2=”Sofas” (no $), each column checks a different cell, so only some cells change color. Use =$B2.
  • $ before the row number: with =$B$2=”Sofas”, every row checks B2, so either all rows or none get highlighted.
  • Wrong starting row: if your selection starts at row 2 but the formula uses row 3, the highlight shifts one row. The row in the formula must match the first row you selected.
  • Selection is one column only: the rule only formats the cells you selected, so select all the columns of the table.

Frequently Asked Questions

How do I highlight rows in an Excel table that grows?

Convert the data into an Excel table (Ctrl + T) and apply the rule to the whole table. When you add new rows to the table, the rule extends to them on its own.

Can I highlight rows based on a date?

Yes. Compare the date column with TODAY(), like =$E2<TODAY() for overdue rows, where column E has the dates.

How do I edit or remove the row rule?

Go to Home > Conditional Formatting > Manage Rules, choose “This Worksheet” in the list at the top, and then edit or delete the rule.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel