Populate Based on Date and Criteria

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
928
Office Version
  1. 365
Hi,

I have the following in Table 1 which shows the date the customer visited the outlet.

Table 1
Customer IDVisit Date
C0013/7/2023
C0023/7/2023
C0033/7/2023
C0043/7/2023
C0053/7/2023
C0014/7/2023
C0024/7/2023
C0034/7/2023
C0044/7/2023
C0044/7/2023
C0054/7/2023
C0015/7/2023
C0025/7/2023
C0035/7/2023
C0045/7/2023
C0055/7/2023
C0011/8/2023
C0021/8/2023
C0031/8/2023
C0041/8/2023
C0051/8/2023
C0014/8/2023
C0024/8/2023
C0034/8/2023
C0044/8/2023
C0054/8/2023

I have the following which shows the date the customer logs into our mobile application:

Table 2
Customer IDLogin Date
C0044/7/2023
C0055/7/2023
C0012/8/2023
C0022/8/2023

I have the following in Table 3:
Table 3
Customer IDVisit DateLogin After Visit
C0013/7/20230
C0023/7/20230
C0033/7/20230
C0043/7/20230
C0053/7/20230
C0014/7/20230
C0024/7/20230
C0034/7/20230
C0044/7/20232
C0044/7/20232
C0054/7/20230
C0015/7/20230
C0025/7/20230
C0035/7/20230
C0045/7/20230
C0055/7/20233
C0011/8/20234
C0021/8/20234
C0031/8/20230
C0041/8/20230
C0051/8/20230
C0014/8/20230
C0024/8/20230
C0034/8/20230
C0044/8/20230
C0054/8/20230

In the third column in Table 3 ( Login After Visit), I am trying to summarize as follows:

If the customer logs into the mobile apps on or after the visit to the branch, the formula should return the value as the number of times after the visit to the outlet that customer logs into the app. Example fopr customer C004, he visited the branch twice and only then logs into the app. Therefore, the result is 2. For customer C001, he logs into the app after the 4th visit to the outlet, therefore the results is 4. Customer C003 has never logged into the app and therefore the result will be 0.

Is there a way to create a formula for the above ? Appreciate all the help.
 
Perhaps I am understanding a bit better now. Try this one.

23 07 04.xlsm
DEFGHI
1Table 2Table 3
2Customer IDLogin DateCustomer IDVisit DateLogin After Visit
3C0044/07/2023C0013/07/20230
4C0055/07/2023C0023/07/20230
5C0012/08/2023C0033/07/20230
6C0022/08/2023C0043/07/20230
7C0053/07/20230
8C0014/07/20230
9C0024/07/20230
10C0034/07/20230
11C0044/07/20232
12C0044/07/20232
13C0054/07/20230
14C0015/07/20230
15C0025/07/20230
16C0035/07/20230
17C0045/07/20230
18C0055/07/20233
19C0011/08/20234
20C0021/08/20234
21C0031/08/20230
22C0041/08/20230
23C0051/08/20230
24C0014/08/20230
25C0024/08/20230
26C0034/08/20230
27C0044/08/20230
28C0054/08/20230
Visits (2)
Cell Formulas
RangeFormula
I3:I28I3=LET(C,G$3:G$28,V,H$3:H$28,LI,VLOOKUP(G3,D$3:E$6,2,0),IF(H3=MAXIFS(V,C,G3,V,"<="&LI),COUNT(UNIQUE(FILTER(V,(C=G3)*(V<=LI),""))),0))
 
Upvote 0
Solution

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi Peter,

Thank you and the solution worked. Appreciate your patience and have a great day ahead . 🙏
 
Upvote 0
Hi Peter,

Thank you and the solution worked. Appreciate your patience and have a great day ahead . 🙏
You're welcome.
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,217,035
Messages
6,134,121
Members
449,861
Latest member
DMJHohl

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