highlight consecutive duplicates more than 3

LuluJ

New Member
Joined
Jun 8, 2021
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
Hi, I would like to format my spreadsheet so that it highlights duplicate entries that are consecutive, but only if they're more than a certain number, say 3. For instance, this is my data: F2: 1/1/21, F3: 1/1/21, F4: 1/3/21, F5: 1/1/21, F6: 1/1/21, F7: 1/1/21, F8: 1/1/21, F9: 1/5/21, F10: 1/5/21. In this case, I would like F5 through F8 to be highlighted (or I'd take just highlighting F8 if that's easier) because there are more than 3 dates that are the same consecutively. F2 and F3 or F9 and F10 would not be highlighted because there are only 2 that are consecutively the same. I've tried to combine rules for consecutive duplicates and counting more than a certain number and I've tried using those formulas as two stacked rules but I've gotten nothing to work right so far.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi LuluJ,

I can highlight the 3rd and subsequent duplicates like this (NOTE: The format must start in row 4 because rows 2 and 3 cannot have two previous duplicates):

LuluJ.xlsx
F
1Dates
21/1/2021
31/1/2021
41/3/2021
51/1/2021
61/1/2021
71/1/2021
81/1/2021
91/5/2021
101/5/2021
11
12
13
14
15
16
17
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F4:F16Expression=AND(F4<>"",F2=F3,F3=F4)textNO
 
Upvote 0
Hi LuluJ,

I can highlight the 3rd and subsequent duplicates like this (NOTE: The format must start in row 4 because rows 2 and 3 cannot have two previous duplicates):

LuluJ.xlsx
F
1Dates
21/1/2021
31/1/2021
41/3/2021
51/1/2021
61/1/2021
71/1/2021
81/1/2021
91/5/2021
101/5/2021
11
12
13
14
15
16
17
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F4:F16Expression=AND(F4<>"",F2=F3,F3=F4)textNO
Thanks for the quick reply but I'm afraid things are a little more complicated. I listed 10 values to make my issue easy to understand but I actually have hundreds of lines of data with many repeated dates. I have copied a sample of some of my actual data:

Book1.xlsx
A
1Date Given
25/1/2021
35/1/2021
45/1/2021
55/8/2021
65/8/2021
75/8/2021
85/9/2021
95/9/2021
105/9/2021
115/10/2021
125/10/2021
135/15/2021
145/15/2021
155/15/2021
165/15/2021
175/18/2021
185/18/2021
195/18/2021
205/19/2021
215/19/2021
225/19/2021
235/19/2021
245/21/2021
255/5/2021
265/5/2021
275/5/2021
285/6/2021
295/7/2021
305/12/2021
315/12/2021
325/12/2021
335/13/2021
345/13/2021
355/14/2021
365/17/2021
375/17/2021
385/17/2021
395/18/2021
405/18/2021
415/10/2021
425/10/2021
435/10/2021
445/10/2021
455/10/2021
465/10/2021
475/10/2021
485/10/2021
495/10/2021
505/13/2021
515/17/2021
525/17/2021
535/17/2021
545/17/2021
555/17/2021
565/3/2021
575/3/2021
585/6/2021
595/6/2021
605/6/2021
615/6/2021
625/6/2021
635/6/2021
645/6/2021
655/6/2021
665/6/2021
675/6/2021
685/10/2021
695/10/2021
705/10/2021
715/11/2021
725/11/2021
Sheet1
 
Upvote 0
Yes, that's what it does. It highlights the first cell where the two previous rows are the same and also 4th, 5th, etc duplicates until a change.

LuluJ.xlsx
A
1Date Given
25/1/2021
35/1/2021
45/1/2021
55/8/2021
65/8/2021
75/8/2021
85/9/2021
95/9/2021
105/9/2021
115/10/2021
125/10/2021
135/15/2021
145/15/2021
155/15/2021
165/15/2021
175/18/2021
185/18/2021
195/18/2021
205/19/2021
215/19/2021
225/19/2021
235/19/2021
245/21/2021
255/5/2021
265/5/2021
275/5/2021
285/6/2021
295/7/2021
305/12/2021
315/12/2021
325/12/2021
335/13/2021
345/13/2021
355/14/2021
365/17/2021
375/17/2021
385/17/2021
395/18/2021
405/18/2021
415/10/2021
425/10/2021
435/10/2021
445/10/2021
455/10/2021
465/10/2021
475/10/2021
485/10/2021
495/10/2021
505/13/2021
515/17/2021
525/17/2021
535/17/2021
545/17/2021
555/17/2021
565/3/2021
575/3/2021
585/6/2021
595/6/2021
605/6/2021
615/6/2021
625/6/2021
635/6/2021
645/6/2021
655/6/2021
665/6/2021
675/6/2021
685/10/2021
695/10/2021
705/10/2021
715/11/2021
725/11/2021
73
74
75
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:A1910Expression=AND(A4<>"",A2=A3,A3=A4)textNO
 
Upvote 0
Yes, that's what it does. It highlights the first cell where the two previous rows are the same and also 4th, 5th, etc duplicates until a change.

LuluJ.xlsx
A
1Date Given
25/1/2021
35/1/2021
45/1/2021
55/8/2021
65/8/2021
75/8/2021
85/9/2021
95/9/2021
105/9/2021
115/10/2021
125/10/2021
135/15/2021
145/15/2021
155/15/2021
165/15/2021
175/18/2021
185/18/2021
195/18/2021
205/19/2021
215/19/2021
225/19/2021
235/19/2021
245/21/2021
255/5/2021
265/5/2021
275/5/2021
285/6/2021
295/7/2021
305/12/2021
315/12/2021
325/12/2021
335/13/2021
345/13/2021
355/14/2021
365/17/2021
375/17/2021
385/17/2021
395/18/2021
405/18/2021
415/10/2021
425/10/2021
435/10/2021
445/10/2021
455/10/2021
465/10/2021
475/10/2021
485/10/2021
495/10/2021
505/13/2021
515/17/2021
525/17/2021
535/17/2021
545/17/2021
555/17/2021
565/3/2021
575/3/2021
585/6/2021
595/6/2021
605/6/2021
615/6/2021
625/6/2021
635/6/2021
645/6/2021
655/6/2021
665/6/2021
675/6/2021
685/10/2021
695/10/2021
705/10/2021
715/11/2021
725/11/2021
73
74
75
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:A1910Expression=AND(A4<>"",A2=A3,A3=A4)textNO
It's not working when I paste the formula into my sheet (I'm putting it into conditional formatting under a new rule). When I put that formula in, I get this (sample of some of my data):

Employee Training History Report.xlsx
F
1Date Given
25/1/2021
35/1/2021
45/1/2021
55/8/2021
65/8/2021
75/8/2021
85/9/2021
95/9/2021
105/9/2021
115/10/2021
125/10/2021
135/15/2021
145/15/2021
155/15/2021
165/15/2021
175/18/2021
185/18/2021
195/18/2021
205/19/2021
215/19/2021
225/19/2021
235/19/2021
245/21/2021
255/21/2021
265/21/2021
275/21/2021
285/26/2021
295/26/2021
305/26/2021
315/24/2021
325/24/2021
335/24/2021
345/24/2021
355/24/2021
365/24/2021
375/24/2021
385/24/2021
395/24/2021
405/24/2021
415/27/2021
425/27/2021
435/27/2021
445/27/2021
455/27/2021
465/27/2021
475/27/2021
485/27/2021
495/27/2021
505/27/2021
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F:FExpression=AND(F4<>"",F2=F3,F3=F4)textNO
 
Upvote 0
You selected the whole of column F for the formula but as I originally said "NOTE: The format must start in row 4 because rows 2 and 3 cannot have two previous duplicates" so apply to something like F4:F99999 and it should work.
 
Upvote 0
Solution
You selected the whole of column F for the formula but as I originally said "NOTE: The format must start in row 4 because rows 2 and 3 cannot have two previous duplicates" so apply to something like F4:F99999 and it should work.
Thank you Toadstool. It looks like it's finally working.
 
Upvote 0

Forum statistics

Threads
1,214,942
Messages
6,122,366
Members
449,080
Latest member
Armadillos

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