Conditional formatting a row based on change in data

paprikajo

New Member
Joined
Sep 13, 2012
Messages
1
Hi trying to shade rows in groups based on when the data in column 1 changes.
ex.

col A B C
1john data data
2john data data
3jane data data
4 jim data data
5jim data data

Shade 1 & 2 with john, the whole row
no shade line 3
shade line 4,5 with jim, the whole row

I tried the formula =MOD(ROUND(SUMPRODUCT((A$2:A2<>"")/COUNTIF(A$2:A2,A$2:A2)),0),2)

This works great shading as the data changes, but it doesn't shade the whole row. Only column A. Can you help modify the formula to shade the whole row?

Thanks.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi trying to shade rows in groups based on when the data in column 1 changes.
ex.

col A B C
1john data data
2john data data
3jane data data
4 jim data data
5jim data data

Shade 1 & 2 with john, the whole row
no shade line 3
shade line 4,5 with jim, the whole row

I tried the formula =MOD(ROUND(SUMPRODUCT((A$2:A2<>"")/COUNTIF(A$2:A2,A$2:A2)),0),2)

This works great shading as the data changes, but it doesn't shade the whole row. Only column A. Can you help modify the formula to shade the whole row?

Thanks.
Select the entire range of cells that you want to format. Let's assume you want to format A2:C10.

Select the *entire* range A2:C10 starting from cell A2.
Cell A2 will be the active cell. The active cell is the
one cell in the selected range that is not shaded. The
formula will be relative to the active cell.

And use this formula:

=MOD(ROUND(SUMPRODUCT(($A$2:$A2<>"")/COUNTIF($A$2:$A2,$A$2:$A2)),0),2)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top