Highlight Entire Rows With Conditional Formatting
Learn how to highlight whole rows or alternating bands in Excel with a formula rule that uses anchored references, so each row is checked on its own.
If you have ever scanned a long Excel sheet for overdue invoices or late shipments, you know how hard it is to follow a single value across a wide row. Highlighting only the one cell that matches a condition helps less than you would expect, because your eye still has to travel back to the row's other columns. Coloring the entire row solves that problem, but the setup is less obvious than it looks, especially when you want the color to depend on one column or when you want every other row shaded.
This guide is for anyone who works with spreadsheets in Excel, including Excel for the web, and wants to apply conditional formatting across a full row or an entire table. You will learn the one idea that makes whole-row rules work, which is a formula that points at the first row of your selection with the column locked. You will also learn how to build banded (every other row) shading, and how to check that the result is correct.
The steps below use desktop Excel as the reference, but the logic is identical in the web version. Menu wording varies between versions, so look for the conditional formatting tools and the option that lets you create a rule with a formula.
How do you highlight a row with conditional formatting in Excel? The short answer
Create a rule that uses a formula, select the full data range, and write the formula against the first row with the key column anchored, so Excel checks each row separately.
| Your situation | What to do | Why |
|---|---|---|
| Color a row when one column meets a condition | Use a formula such as =$C2="Overdue" on the data rows | The $ locks the column, so the same column is tested in every row |
| Shade alternating rows for readability | Use =MOD(ROW(),2)=0 on the data rows | It colors every second row without needing a separate rule for each one |
| Highlight a whole table that grows over time | Apply the rule to a range that includes new rows, or to a Table object | The rule follows the data as rows are added |
| Highlight based on a number threshold | Use a formula such as =$D2>5000 | Comparing a single anchored column keeps the row color tied to one value |
| Rule colors only one cell, not the row | Check that the Applies to range covers every column, not just one | A range limited to one column formats only that column |
Before you start
Gather these details first so you do not have to rebuild the rule later.
- Know which column drives the color. One column should hold the value that decides whether a row is highlighted, such as a status or amount. A rule that depends on several columns is harder to read and to fix.
- Note where the data starts and ends. For a 30-row sales list with headers in row 1, the data is in rows 2 through 31. Knowing the exact row numbers lets you select the right range and avoid formatting the header.
- Decide whether the sheet has blank rows. Blank rows inside the range can receive the color, so either remove them or make the formula skip empty cells, for example =AND($C2<>"",$C2="Overdue").
- Decide if you want a Table object. A Table expands automatically when you type in the row below it, which keeps the rule current. A plain range does not expand on its own.
- Save a copy. Conditional formatting is easy to change, but a copy lets you compare before and after if the result looks wrong.
Applying a whole-row rule in Excel, step by step
- Select only the data rows. Click the first data cell, such as A2, and drag to the last cell in the last column of the data, such as E31. Leaving out the header row keeps its formatting unchanged.
- Open the conditional formatting tools and create a new rule. Choose the option that lets you use a formula to decide which cells to format. This is the only rule type that can reference another column for each row.
- Enter the formula relative to the first selected row. Because you started at A2, write the formula as if you were in A2. For example, =$C2="Overdue" tests column C in each row. The dollar sign locks the column, while the row number moves down with each row.
- Pick the format. Choose a fill color, and optionally a font color or bold. Keep the color light enough that the text stays easy to read.
- Confirm that the Applies to range covers the full row. It should read something like A2:E31, not just C2:C31. If the range is only the key column, only that column changes color.
- Create a second rule for banded rows if you need one. Select the same data range, create a new formula rule, and enter =MOD(ROW(),2)=0. This colors every even-numbered row, which is a common banding pattern. Use a light fill so it does not compete with a highlight rule.
- Set the rule order. When two rules apply to the same row, Excel uses the one higher in the list for conflicting formats. Put the highlight rule above the banding rule so the highlight wins.
- Test with one changed value. Change one status in column C to the trigger word and confirm that the whole row changes. Change it back afterward.
Check the result
Run these checks once the rule is in place, and again after you add or sort rows.
| Check | How to see it | If it's wrong |
|---|---|---|
| The whole row is colored, not just one cell | Look across every column in a highlighted row | Open the rule and make sure the Applies to range includes all columns |
| The header is unchanged | Scroll to row 1 and confirm it has its original formatting | Reselect the range starting at row 2 and edit the rule |
| The formula points at the right column | Click a formatted cell and read the rule's formula | Add the $ before the column letter, and check that the row number matches your first data row |
| Banded rows alternate correctly | Scan the sheet for two shaded rows in a row | Confirm the MOD formula is on the data range and that no other rule overrides it |
| New rows get the same formatting | Type a test value in the row below the data | Extend the range, or convert the data to a Table so the rule follows new rows |
| Colors overlap or disappear | Compare the order of rules in the rules manager | Move the highlight rule above the banding rule, or set the banding rule to stop when it applies |
If a row is colored that should not be, check the formula for a missing dollar sign or a wrong row number. A missing $ before the column letter is a common cause of a rule that behaves differently from row to row.
❓ FAQ
1. Why does my conditional formatting only color one cell?
A common cause is that the Applies to range covers only one column. Whole-row formatting requires the full set of data columns in that range. A formula without a column anchor can also cause mixed results, because Excel checks a different cell in each column.
2. Which formula should I use for each type of row highlight?
Use a comparison that tests one anchored column, such as =$C2="Overdue" for text or =$D2>5000 for numbers. For a row that should highlight only when two conditions are both true, combine them with AND, for example =AND($C2="Overdue",$D2>5000). Keep each rule to one clear purpose so it is easy to edit later.
3. Do I need a Table object for the rule to work?
No. A plain range works as long as the Applies to range covers every row you care about. A Table is useful when you add rows often, because it expands and carries the formatting into new rows without you editing the rule.
📝 Summary
To highlight an entire row with conditional formatting in Excel, select the data rows without the header, create a formula rule that anchors the key column with a dollar sign, and set the range to cover every column. Add a separate MOD rule for alternating row shading, then check the range, the rule order, and a test value. With those pieces in place, your highlighted rows will stay correct as the sheet grows.


