Skip to main content

Apply conditional formatting for each row in Excel

As we know, the Conditional Formatting will create a rule to determine which cells will be format. Sometimes, you may want to apply the conditional formatting for per row as below screenshot shown. Except repeatedly setting the same rules for per row, there are some tricks on solving this job.
doc conditional formatting for each row 1


Method A Change the Applies to in Conditional Formatting Rules Manager

For instance, here you want to apply the fill background color to the cells if A2>B2, A3>B3, …, An>Bn with conditional formatting.

1. Firstly, apply the conditional formatting to A2:B2. Select A2:B2, then click Home > Conditional Formatting > New Rule. If there are rules in the row already, just directly jump to the step 4.
doc conditional formatting for each row 2

2. In the New Formatting Rule dialog, select Use a formula to determine which cells to format from Select a Rule Type section, then type =$A2>$B2 into the textbox under Format values where this formula is true.
doc conditional formatting for each row 3

3. Click Format button to go to the Format Cells dialog, and then you can choose one formatting type as you need. For instance, fill background color. Click OK > OK to close dialogs.
doc conditional formatting for each row 4

Now the row A2:B2 is applied conditional formatting.

4. Keep A2:B2 selected, click Home > Conditional Formatting > Manage Rules.
doc conditional formatting for each row 5

5. In the Conditional Formatting Rules Manager dialog, find the rule you applied to A2:B2, change the range as you need in Applies to section, and click OK.
doc conditional formatting for each row 6

Then this conditional formatting rule will be applied to each row in the new range.
doc conditional formatting for each row 7



Method B Drag the AutoFill handle

If you are using Excel 2013 or later versions, you can use the AutoFill handle to apply the conditional rule to adjacent rows.

Supposing row A2:B2 have applied two conditional formatting, if A2>B2, fill red background color, if A2<B2, fill green background color.

Now you want to apply these two rules to A3:B9.

1. Firstly, you need to apply conditional formatting rules to the row A2:B2. If there are rules existing in the row, just directly jump to the step 4. Select range A2:B2, click Home > Conditional Formatting > New Rule. If there are rules in the row already, just directly jump to the step 4.

2. In the New Formatting Rule dialog, select Use a formula to determine which cells to format from Select a Rule Type section, then type =$A2>$B2 into the textbox under Format values where this formula is true. Then click Format button, in the Format Cells dialog, under Fill tab, select red color. Click OK > OK.
doc conditional formatting for each row 8

3. Keep the row A2:B2 selected, enable the New Formatting Rule dialog again, select Use a formula to determine which cells to format from Select a Rule Type section, then type =$A2<$B2 into the textbox under Format values where this formula is true. Then click Format button, in the Format Cells dialog, under Fill tab, select green color. Click OK > OK.
doc conditional formatting for each row 9

4. Then drag the AutoFill handle to adjacent rows which you want to apply the conditional rule to, then in select Fill Formatting Only from the Auto Fill Options.
doc conditional formatting for each row 10


Sample File

Click to download the sample file

Other Operations (Articles) Related To Conditioanl Formatting

Count/sum cells by colors with conditional formatting in Excel
Now this tutorial will tell you some handy and easy methods to quickly count or sum the cells by color with conditional formatting in Excel.

create a chart with conditional formatting in Excel
For example, you have a score table of a class, and you want to create a chart to color scores in different ranges, here this tutorial will introduce the method on solving this job.

Conditional formatting stacked bar chart in Excel
This tutorial, it introduces how to create conditional formatting stacked bar chart as below screenshot shown step by step in Excel.

Conditional formatting rows or cells if two columns equal in Excel
In this article, I introduce the method on conditional formatting rows or cells if two columns equal in Excel.

Search and highlight search results in Excel
In Excel, you can use the Find and Replace function to find a specific value, but do you know how to highlight the search results after searching? In this article, I introduce two different ways to help you search and highlight search results at the meanwhile in Excel.


  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...
kte tab 201905
  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
THANK YOU! was trying to figure that out for some time now.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations