Count formula - Cohort analysis

Creekleo

New Member
Joined
Dec 15, 2021
Messages
30
Office Version
  1. 2013
Platform
  1. Windows
Hello community,

I'm working on a cohort analysis that goes like this :

I want to calculate the retention rate of customers: in this case, I want to count the numbers of people that purchased in july 2021 ( unique Ids ) and then see if theses people came back to purchase again in august and septembre. ( i tried to explain in the file below )

this is just a simple example. my data set is huge ( over million row ). I just want to test a formula that will work.

thanks all.

New Microsoft Excel Worksheet.xlsx
BCDEFGHIJK
3ID CustomerDate of operationMonth
4IC68662101/07/20217CohortJuly - Start MonthAugustSeptembre
5IC68662101/07/20217Jul-21Count unique ID's of people that purchased in julyCount IDS of the july population that purchased again in augustCount IDS of the july population that purchased again in Septembre
6IC68662101/07/20217
7IC68662101/07/20217
8IC68662101/07/20217
9IC68662101/07/20217
10IC68662101/07/20217
11IC68662101/07/20217
12IC68662101/07/20217
13IC68662101/07/20217
14IC68662101/07/20217
15IC68662101/07/20217
16IC789001/07/20217
17IC789001/07/20217
18IC789001/07/20217
19IC789001/07/20217
20IC789001/07/20217
21IC789001/07/20217
22IC789001/07/20217
23IC789001/07/20217
24IC789001/07/20217
25IC789001/07/20217
26IC6800001/07/20217
27IC6800001/07/20217
28IC6800001/07/20217
29IC6800001/07/20217
30IC6800001/07/20217
31IC6800001/07/20217
32IC6800001/07/20217
33IC6800001/07/20217
34IC6800001/07/20217
35IC6800001/07/20217
36IC6800001/07/20217
37IC6800001/07/20217
38IC6800001/07/20217
39IC6800001/07/20217
40IC6800001/07/20217
41IC6800001/07/20217
42IC6800001/07/20217
43IC6800001/07/20217
44IC6800001/07/20217
45IC6800001/07/20217
46IC6800001/07/20217
47IC6800001/07/20217
48IC6800001/07/20217
49IC6800001/07/20217
50IC6800001/07/20217
51IC6800001/07/20217
52IC6800001/07/20217
53IC68662105/08/20218
54IC68662105/08/20218
55IC68662105/08/20218
56IC68662105/08/20218
57IC68662105/08/20218
58IC68662105/08/20218
59IC68662105/08/20218
60IC68662105/08/20218
61IC68662105/08/20218
62IC68662105/08/20218
63IC68662105/08/20218
64IC68662105/08/20218
65IC6800005/09/20219
66IC6800005/09/20219
67IC6800005/09/20219
68IC6800005/09/20219
69IC6800005/09/20219
70IC6800005/09/20219
71IC6800005/09/20219
72IC6800005/09/20219
73IC6800005/09/20219
74
75
76
Sheet1
Cell Formulas
RangeFormula
D4:D73D4=MONTH(C4)
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
a power query solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date of operation", type date}}),
    #"Inserted Month" = Table.AddColumn(#"Changed Type", "Month", each Date.Month([Date of operation]), Int64.Type),
    #"Grouped Rows" = Table.Group(#"Inserted Month", {"ID Customer", "Month"}, {{"Count", each Table.RowCount(Table.Distinct(_)), Int64.Type}})
in
    #"Grouped Rows"
 
Upvote 0
a power query solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date of operation", type date}}),
    #"Inserted Month" = Table.AddColumn(#"Changed Type", "Month", each Date.Month([Date of operation]), Int64.Type),
    #"Grouped Rows" = Table.Group(#"Inserted Month", {"ID Customer", "Month"}, {{"Count", each Table.RowCount(Table.Distinct(_)), Int64.Type}})
in
    #"Grouped Rows"
Thank you for your response mr. Alan.
I don't know how to apply this methode in power query. is it a vba code ? thank you
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
Thank you . well explained.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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