How to find duplicates within 5 days of each other in data set

szita2000

Board Regular
Joined
Apr 25, 2012
Messages
101
Office Version
  1. 365
Platform
  1. Windows
ABCDE
DateNameProductConcanCount
Daffy DuckAppleDaffy DuckApple
Bugs BunnyPear
Bugs BunnyOrange
Bugs BunnyOrange
Pepe Le PewKiwi
Daffy DuckApple

<tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]01/01/2018[/TD]

[TD="align: right"]0[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]03/01/2018[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]03/01/2018[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]07/01/2018[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]12/01/2018[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]05/01/2018[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D2[/TH]
[TD="align: left"]=B2&C2[/TD]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]E2[/TH]
[TD="align: left"]=COUNTIFS($D:$D,$D2,$A:$A,$A2>=($A2+5),$A:$A,$A2<=($A2+5))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




[TABLE="width: 85%"]
<tbody>[TR]
[TD]Hi Guys.

I can't figure this one out.
In the data set above I have to highlight duplicates that are occur within 5 days of each other.
(This is to filter out of someone processed the same purchasing twice by accident)

I tried to concatenate the name and product in to a helper column on D:D - That would make each purchase unique,
I can't work out how to collect and compare the date after the combinations.
I tried to go with count ifs but the criterias of >= than date +5 days doesn't seems to be working.
In the data set above Line 2,7 and 4,5 should be highlighted/put in to a separate list somehow

Any ideas most welcome[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You are almost there I think:


Excel 2010
ABCD
1DateNameProductdupe?
21/1/2018Daffy DuckAppleTRUE
31/3/2018Bugs BunnyPearFALSE
41/3/2018Bugs BunnyOrangeTRUE
51/8/2018Bugs BunnyOrangeTRUE
61/12/2018Pepe Le PewKiwiFALSE
71/5/2018Daffy DuckAppleTRUE
Sheet2
Cell Formulas
RangeFormula
D2=COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,C2,$A$2:$A$7,"<"&A2+6,$A$2:$A$7,">"&A2-6)>1
D3=COUNTIFS($B$2:$B$7,B3,$C$2:$C$7,C3,$A$2:$A$7,"<"&A3+6,$A$2:$A$7,">"&A3-6)>1
D4=COUNTIFS($B$2:$B$7,B4,$C$2:$C$7,C4,$A$2:$A$7,"<"&A4+6,$A$2:$A$7,">"&A4-6)>1
D5=COUNTIFS($B$2:$B$7,B5,$C$2:$C$7,C5,$A$2:$A$7,"<"&A5+6,$A$2:$A$7,">"&A5-6)>1
D6=COUNTIFS($B$2:$B$7,B6,$C$2:$C$7,C6,$A$2:$A$7,"<"&A6+6,$A$2:$A$7,">"&A6-6)>1
D7=COUNTIFS($B$2:$B$7,B7,$C$2:$C$7,C7,$A$2:$A$7,"<"&A7+6,$A$2:$A$7,">"&A7-6)>1
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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