Spreadsheet: 797760d1664138385-formula-to-find-the-time-between-two-purchase-dates-recency-f_rs_ker-
Sheet: Transaction_export_2022-09-22 1

Customer ID | Purchase date and time | Purchase date - Month | Purchases |  | Customer ID | Expected result - Time between purchases - Months |  |  | BYROW/LAMBDA >>>> |  |  | Greg | Greg+TMS |  | [NAME]'s combination formula
d9e94420-3d19-449f-a471-af030119f773 | 2022-09-22 16:17:56 |  | 1 |  |  | 4 | 4 |  |  |  |  |  |  |  |  | 4
d9e94420-3d19-449f-a471-af030119f773 | 2022-09-22 16:17:56 |  | 1 |  | 51a50013-a84f-4f2c-be93-ac9500a939b0 | 2 | 2 |  | 2 | 2 |  | 2 | 2 |  | 51a50013-a84f-4f2c-be93-ac9500a939b0 | 2
51a50013-a84f-4f2c-be93-ac9500a939b0 | 2022-09-22 15:45:44 |  | 1 |  | 146822c3-14ea-4c66-a603-aee100b0cbcb | 7 | 7 |  | 7 | 7 |  | 7 | 7 |  | 146822c3-14ea-4c66-a603-aee100b0cbcb | 7
51a50013-a84f-4f2c-be93-ac9500a939b0 | 2022-09-22 15:45:44 |  | 1 |  | aac5a843-62ac-41ab-98a8-ae7700a07767 | 8 | 8 |  | 8 | 8 |  | 8 | 8 |  | aac5a843-62ac-41ab-98a8-ae7700a07767 | 8
146822c3-14ea-4c66-a603-aee100b0cbcb | 2022-09-22 14:41:23 |  | 1 |  | 23fd7787-fb62-457a-9302-adec00feb15d | 11 | 1 |  | 1 | 1 |  | 11 | 11 |  | 23fd7787-fb62-457a-9302-adec00feb15d | 11
146822c3-14ea-4c66-a603-aee100b0cbcb | 2022-09-22 14:41:23 |  | 1 |  | *** Star Prize ***
146822c3-14ea-4c66-a603-aee100b0cbcb | 2022-09-22 14:41:23 |  | 1 |  |  |  |  |  | BYROW/LAMBDA >>>>
146822c3-14ea-4c66-a603-aee100b0cbcb | 2022-09-22 14:41:23 |  | 1 |  |  |  |  |  |  |  |  |  |  |  | Adjusted to cater for F2# having 2 columns
146822c3-14ea-4c66-a603-aee100b0cbcb | 2022-09-22 14:41:23 |  | 1
aac5a843-62ac-41ab-98a8-ae7700a07767 | 2022-09-22 13:30:13 |  | 1
23fd7787-fb62-457a-9302-adec00feb15d | 2022-09-22 13:12:53 |  | 1
Customer ID - Second purchase |  |  |  |  | How do I get the time between their purchases?
d9e94420-3d19-449f-a471-af030119f773 | 2022-05-22 16:17:56 |  | 2
51a50013-a84f-4f2c-be93-ac9500a939b0 | 2022-07-22 15:45:44 |  | 2 |  |  |  |  | =DATEDIF(MINIFS(C:C,A:A,F2#),MAXIFS(C:C,A:A,F2#),"M")
146822c3-14ea-4c66-a603-aee100b0cbcb | 2022-02-22 14:41:23 |  | 2 |  |  |  |  | =LET(ci, UNIQUE(FILTER(A:A,(LEFT(A:A,8)<>"Customer")*(A:A<>""))), [NAME]:C,A:A,ci),MAXIFS(C:C,A:A,ci),"M"))
aac5a843-62ac-41ab-98a8-ae7700a07767 | 2022-01-22 14:41:23 |  | 2
23fd7787-fb62-457a-9302-adec00feb15d | 2023-08-22 14:41:23 |  | 2 |  |  |  |  | =[NAME],FILTER(MONTH(C:C),A:A=F2),MAX(f)-MIN(f))
 |  |  |  |  |  |  |  | =BYROW(F2:F6,LAMBDA(row,[NAME],FILTER(MONTH(C:C),A:A=row),MAX(f)-MIN(f))))
 |  |  |  |  | (Copy of unique Customer IDs) | =UNIQUE(FILTER(A:A,(LEFT(A:A,8)<>"Customer")*(A:A<>""))) |  | =BYROW(F2#,LAMBDA(row,[NAME],FILTER(MONTH(C:C),A:A=row),MAX(f)-MIN(f))))
 |  |  |  |  | d9e94420-3d19-449f-a471-af030119f773
 |  |  |  |  | 51a50013-a84f-4f2c-be93-ac9500a939b0 | 51a50013-a84f-4f2c-be93-ac9500a939b0 |  | =LET(lr,20,f,FILTER(MONTH(C2:INDEX(C:C,lr)),A2:INDEX(A:A,lr)=F2),MAX(f)-MIN(f))
 |  |  |  |  | 146822c3-14ea-4c66-a603-aee100b0cbcb | 146822c3-14ea-4c66-a603-aee100b0cbcb |  | =BYROW(F2:F6,LAMBDA(row,LET(lr,20,f,FILTER(MONTH(C2:INDEX(C:C,lr)),A2:INDEX(A:A,lr)=row),MAX(f)-MIN(f))))
 |  |  |  |  | aac5a843-62ac-41ab-98a8-ae7700a07767 | aac5a843-62ac-41ab-98a8-ae7700a07767 |  | =BYROW(F2#,LAMBDA(row,LET(lr,20,f,FILTER(MONTH(C2:INDEX(C:C,lr)),A2:INDEX(A:A,lr)=row),MAX(f)-MIN(f))))
 |  |  |  |  | 23fd7787-fb62-457a-9302-adec00feb15d | 23fd7787-fb62-457a-9302-adec00feb15d |  | =BYROW(UNIQUE(A2:A12),LAMBDA(row,LET(lr,20,f,FILTER(MONTH(C2:INDEX(C:C,lr)),A2:INDEX(A:A,lr)=row),MAX(f)-MIN(f))))
 |  |  |  |  |  |  |  | =BYROW(UNIQUE(FILTER(A:A,(LEFT(A:A,8)<>"Customer")*(A:A<>""))),LAMBDA(row,LET(lr,20,f,FILTER(MONTH(C2:INDEX(C:C,lr)),A2:INDEX(A:A,lr)=row),MAX(f)-MIN(f))))
 |  |  |  |  |  |  |  | =BYROW(UNIQUE(FILTER(A:A,(LEFT(A:A,8)<>"Customer")*(A:A<>""))),LAMBDA(row,LET(lr,20,f,[NAME]:INDEX(C:C,lr))*12+MONTH(C2:INDEX(C:C,lr)),A2:INDEX(A:A,lr)=row),MAX(f)-MIN(f))))
 |  |  |  |  |  |  |  | =[NAME],UNIQUE(FILTER(A:A,(LEFT(A:A,8)<>"Customer")*(A:A<>""))),CHOOSE({1,2},uc,DATEDIF(MINIFS(C:C,A:A,uc),MAXIFS(C:C,A:A,uc),"M")))