Link to home
Start Free TrialLog in
Avatar of itsmehar
itsmehar

asked on

Alternate row color based on column value

User generated image
Excel 2010

I am trying to highlight the alternate row but if column D is the same it should have the same color.  Please review the embeded image
Avatar of COACHMAN99
COACHMAN99

ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of itsmehar

ASKER

Rgonzo1971,
Your suggestion works, but it only highlights the first column. How do i apply it ot the entire row.
If you apply two conditional formats as in the article I attached, then use paintbrush to apply this formatting to the whole sheet, or wherever you want.
Not for points

To make Rgonzo's suggestion work for the whole row set the "applies to" range to encompass all columns and then change formula to

=$E2

regards, barry
Technique 1: Apply shading to alternate rows by using conditional formatting

One way to apply shading to alternate rows in your worksheet is by creating a conditional formatting rule. This rule uses a formula to determine whether a row is even or odd numbered, and then applies the shading accordingly. The formula is shown here:

=MOD(ROW(),2)=0
1.On the worksheet, do one of the following:
To apply the shading to a specific range of cells, select the cells you want to format.
To apply the shading to the entire worksheet, click the Select All button.
To expand:

You will need two conditional formatting rules after selecting the entire table

The first will require the addition of a column with the formula:
=IF(OR(D2=D3,D2=D1),1,0) (see Attached file)
then create a conditional formatting rule = $F2=1 (Make sure this is the first rule in the rules manager)

The Second as stated above by coachman99 to highlight the alternate rows
Alternate-Row-Formating.xlsx
Hello COACHMAN99,

itsmehar doesn't want to apply conditional formatting to alternate rows, he wants the formatting to be applied to alternate groups of rows based on the entry in column D.

bearblack,

Your suggestion doesn't fulfil the requirement either.

As the asker says, Rgonzo's solution works, he just needed it applied to the whole row, which you can do with my suggested adjustment

regards, barry
the spec says
'highlight the alternate row but if column D is the same it should have the same color'

I assumed this means
1. add alternate shading
2. add additional conditional formatting if column D is same as row above
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I see - thanks