Count duplicates within date range

hinesjoel

New Member
Joined
Feb 20, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a dataset that we record interaction with our customers.

Each interaction is logged by Date, customer ID, reason for interaction.

I want to count the number of interactions with the customer from the first interaction for 14 days (days would be changeable based on reporting timeframe needs)

The functions I have been trying count the total interactions with the customer, I am having trouble limiting the count to 14 days.

No VBA if possible.

Any suggestions?

Thanks,

Joel
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
i have just written a solution to a similar question - not quite the same

So would a COUNTIFS() work

this is where a sample would have helped here
Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

XL2BB is an add-in used on this forum , see my signature or the menu in post to link to the full details
OR put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.

Here is the link to XL2BB instructions


Lets Assume the Date is in column A and Customer ID in B , and Interaction in C

=COUNTIFS( $B$2:B2,B2, $A$2:A2, ">="&A2-14 )
should count based on last 14 days

Various.xlsx
ABC
1DateNameCount
21/22/22A1
31/23/22b1
41/24/22A2
51/25/22b2
61/26/22b3
71/27/22b4
81/28/22A3
91/29/22b5
101/30/22A4
111/31/22A5
122/1/22A6
132/2/22b6
142/3/22A7
152/4/22A8
162/5/22A9
172/6/22A9
182/7/22A10
192/8/22b6
202/9/22A10
212/10/22A11
Sheet1 (2)
Cell Formulas
RangeFormula
C2:C21C2=COUNTIFS( $B$2:B2,B2, $A$2:A2, ">="&A2-14 )


BUT someone here , wanted to reset the date after 14 days , so the count was based not on the last 14 days , but 14 days from the 1st interaction
not sure if my solution actually does work - but have a read here
 
Upvote 0
Thanks,

The formula worked mostly, but I was unable to have the date range in one argument. I had to add a helper cell with date+14. So I ended up with two criteria. One for => first date and the one =< helper cell +14.

Thanks Again,
 
Upvote 0
What about this?

22 02 28.xlsm
ABCDE
1DateNameNameCount 1st 14 days
201-Jan-22AA8
302-Jan-22bb6
403-Jan-22A
504-Jan-22b
605-Jan-22b
706-Jan-22b
807-Jan-22A
908-Jan-22b
1009-Jan-22A
1110-Jan-22A
1211-Jan-22A
1312-Jan-22b
1413-Jan-22A
1514-Jan-22A
1615-Jan-22A
1716-Jan-22A
1817-Jan-22A
1918-Jan-22b
2019-Jan-22A
2120-Jan-22A
22
Count contacts
Cell Formulas
RangeFormula
D2:D3D2=UNIQUE(B2:B21)
E2:E3E2=COUNTIFS(B2:B21,D2#,A2:A21,"<"&MINIFS(A2:A21,B2:B21,D2#)+14)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,519
Members
448,968
Latest member
Ajax40

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