Conditional Formatting - Highlight Row with Duplicate Cells

RY_VT

Board Regular
Joined
Oct 31, 2015
Messages
80
I have a Power Automate flow running that adds rows of Associate information into sheets of an Excel online spreadsheet. I would like to set up conditional formatting so that it highlights rows that have the same "Associate Id#" (First column in each sheet) when that ID number occurs three times. In other words, If an employee has three infractions, they would have three entries on this sheet, and I want the row with the third occurrence of their ID number to be red.

Thanks in advance for any assistance.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
you should be able to use a formula
=countif() or countifs() = 3

so if you want the row

select the range - for example A1:1000
then a formula in conditional formatting
=countif(A1:$A$1, $A1)=3
But i'm not sure of the
Power Automate flow running
So it may need another formula or a macro - which i cannot help with

Book1
ABCDEFG
1ID
21
34
43
54
61
72
84
95
102
115
122
137
14
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:I1,A2:B13,D2:I13,C2:C16Expression=COUNTIF($A$1:A1,$A1)=3textNO
 
Upvote 0
Solution
you should be able to use a formula
=countif() or countifs() = 3

so if you want the row

select the range - for example A1:1000
then a formula in conditional formatting
=countif(A1:$A$1, $A1)=3
But i'm not sure of the

So it may need another formula or a macro - which i cannot help with

Book1
ABCDEFG
1ID
21
34
43
54
61
72
84
95
102
115
122
137
14
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:I1,A2:B13,D2:I13,C2:C16Expression=COUNTIF($A$1:A1,$A1)=3textNO
Working perfectly! Thanks so much for the help!

The power automate aspect is what's pushing the data into the spreadsheet, but that was working properly.

-Ryan
 
Upvote 0
you are welcome
Sorry, one more question- Is it possible to add a string of text to a cell in the row that is highlighted red? If columns A - E are data, could the cell in column F say "3rd Infraction" when the rule triggers?
 
Upvote 0
try in F1 and copy down
=IF(COUNTIF($A$1:A1,$A1)=3,"3rd Infraction","")

Book1
ABCDEFGHI
1ID 
21 
34 
43 
54 
61 
72 
843rd Infraction
95 
102 
115 
1223rd Infraction
137 
Sheet1
Cell Formulas
RangeFormula
F1:F13F1=IF(COUNTIF($A$1:A1,$A1)=3,"3rd Infraction","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:I1,A2:B13,C2:C16,D2:I13Expression=COUNTIF($A$1:A1,$A1)=3textNO
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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