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
1DateNameProductConcanCount
201/01/2018Daffy DuckAppleDaffy DuckApple0
303/01/2018Bugs BunnyPear
403/01/2018Bugs BunnyOrange
507/01/2018Bugs BunnyOrange
612/01/2018Pepe Le PewKiwi
705/01/2018Daffy DuckApple

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2=B2&C2
E2=COUNTIFS($D:$D,$D2,$A:$A,$A2>=($A2+5),$A:$A,$A2<=($A2+5))

<tbody>
</tbody>

<tbody>
</tbody>




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

<tbody>
</tbody>
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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