Cohort Retention Analysis
Operator: Abdulla Al Fahad. How tools are built and checked
A cohort table answers one question: of the people who showed up for the first time in a given week, how many were still around one week later, two weeks later, ten weeks later? Averages over all users hide the answer, because last quarter's sign-ups and this month's behave differently. Grouping users by when they started and following each group separately shows whether the product is getting stickier or whether a good launch week is just masking a leaky bucket.
This page builds that table from an ordinary export. You need one row per event with a user id and a date, and optionally a revenue column. The result is a triangle of counts or percentages with heat colouring, a weighted average row, a retention curve, and a workbook you can open in Excel.
Key features
- Cohorts by day, week (Monday or Sunday start) or calendar month of first activity
- Classic retention (active in exactly that period) or rolling retention (active in that period or later)
- Counts, retention percent, revenue per period and cumulative revenue per user, switchable on one table
- Weighted average row and a retention curve with up to six cohorts drawn against the average
- Unfinished final period left out by default, or kept and marked partial, so the newest column never looks like a false drop
- Optional last-date cutoff, day-first or month-first override for slash dates, and a skipped-rows report with examples
- XLSX with colour-scaled cells on four metric sheets and a Notes sheet; CSV of whichever metric is on screen
Cohorts, periods and what counts as retained
Events can be uploaded (CSV, TSV, TXT or the first sheet of an XLSX; rows past 300,000 are cut, with a note about it) or pasted. User, date and optional revenue columns are guessed from names such as user_id, created_at and revenue, and a drop-down overrides each guess; if no column looks like a date, none is picked and you choose one yourself.
Event logs often carry 10-digit or 13-digit Unix timestamps, and those are accepted alongside ISO dates, written-out dates and Excel serial numbers. Every timestamp is cut down to a calendar day and counted with plain day arithmetic, so a time zone or daylight saving shift cannot push an event into the next week. A slash date such as 03/04/2025 is read month first unless another value (a first part above 12) shows the day comes first, and a drop-down overrides the choice.
Rows with no user id or an unreadable date are skipped, and the page reports the counts with the first few row numbers so you can find them. A revenue cell that is not a number does not drop the event: the event still counts as activity with revenue 0, and the number of such cells is shown. Currency symbols, thousands commas and accounting negatives such as (12.50) are understood in the revenue column.
A cohort is the day, week or month of a user's first event. Weeks run Monday to Sunday or Sunday to Saturday, your choice, and months are calendar months. You can show up to 36 periods after the first, and up to 36 cohorts at a time on the page, either the most recent or the earliest; the downloads always include every cohort. The workbook has one sheet each for retention percent, users, revenue and cumulative revenue per user (the last two only when a revenue column is chosen), plus a Notes sheet that states the definitions used.
How it works
Each event is mapped to a period number: for days it is the day count since 1970, for weeks the count of whole weeks with the chosen start day, and for months the year times twelve plus the month. A user's cohort is the smallest period number among their events, and an event's offset is its own period minus that cohort. A user who has three events in one week is therefore counted once for that week, because the table counts users, not events.
In classic mode a cell holds the number of cohort users with at least one event at that offset. In rolling mode it holds the number whose latest event is at that offset or later, which is why a rolling row can never go up. Retention percent divides by the cohort size, so offset 0 is always 100 percent in classic mode.
A cell is shown only if its period has already ended. The last period in the data is compared with the date of the final event: if that event is not on the last day of its week or month, the period is unfinished. By default its events are left out altogether and no cohort starts in it, which keeps the right-hand diagonal honest. If you keep it, those cells are italic with an asterisk and are excluded from the averages. The weighted average at offset N adds the retained users of every cohort that has reached N and divides by the sum of those cohorts' sizes.
Cumulative revenue per user at offset N is the cohort's revenue from offset 0 through N divided by the cohort size, and revenue is attributed to the cohort of the user who earned it, not to the calendar period of the sale. The heat colour of a retention cell is its percentage; for revenue sheets it is the value relative to the largest value on the sheet.
Common use cases
- A founder exports sign-up and login events from a database and wants to know if the January launch cohort stuck around better than the November one, without paying for a product analytics plan.
- A subscription shop checks how much cumulative revenue per customer each monthly cohort has produced by month six, to compare it with what a campaign cost to acquire them.
- A community manager uses day cohorts for a two-week challenge to see how many participants came back on day 1, day 3 and day 7.
- An analyst has a spreadsheet of order lines and needs a colour-scaled cohort workbook to paste into a slide, with the definitions on a Notes sheet so nobody asks how retention was counted.
How to use this tool
- Choose the events file, paste events, or press Use sample data to see a made-up set of eight weekly sign-up groups.
- Check the three detected columns and change them if the guess is wrong. Pick a revenue column if you want revenue and lifetime value.
- Pick day, week or month cohorts, and classic or rolling retention. If your dates are written 03/04/2025, check the day-first or month-first setting.
- Set how many periods to show, and optionally a last date to count.
- Read the heat table, switch between retention percent, users and revenue, and tick cohorts under the curve to compare them with the average.
- Download the XLSX for the full workbook or the CSV for the metric on screen.
Example
Nine events, grouped by week (Monday start)
user,date,rev
A,2025-03-03,10
A,2025-03-11,10
A,2025-03-17,10
B,2025-03-04,5
B,2025-03-18,5
C,2025-03-05,1
C,2025-03-06,1
D,2025-03-12,7
E,2025-03-23,0Weekly cohorts, classic retention
Cohort Users Wk0 Wk1 Wk2
2025-03-03 3 100% 33.3% 66.7% (A,B,C; B skips week 1, C's two events count once)
2025-03-10 1 100% 0% blank (D)
2025-03-17 1 100% blank blank (E)
Weighted avg 100% 25.0% 66.7% (week 1: 1 of 4 users, week 2: 2 of 3)
Rolling retention for the first cohort: 100%, 66.7%, 66.7%.
Revenue of the first cohort per week: 17, 10, 15; cumulative per user: 5.67, 9.00, 14.00.Tips for best results
- Pick the unit that matches how often people could plausibly return. Weekly cohorts suit most apps; day cohorts only make sense for products used daily, and monthly cohorts need a long history to give more than a few rows.
- Use rolling retention when the question is whether people are gone for good, and classic retention when the question is whether they were active in that particular period. Classic numbers can bounce back after a dip, rolling numbers cannot.
- Filter the export to one meaningful action first, such as a purchase or a session start. A table built from every logged event counts a background sync as a visit.
- Set a last date to compare datasets pulled on different days, so both stop at the same Sunday.
- If a cohort is tiny, treat its percentages with suspicion: one user is 20 percent of a five-person cohort. The Users column is there for that reason.
Common pitfalls
A user's first event in the file is not necessarily their first ever event. If the export starts on 1 February, everyone who was already active before then lands in the February cohort, which inflates its size and its retention. Export from the start of the product, or treat the first cohort as a mix of old and new users.
Ids that differ only in case or spelling are different users here. The tool trims spaces but does not merge Alice@x.com with alice@x.com; clean the column first.
Revenue is summed as written. Refunds as negative numbers reduce it, and different currencies in one column are added together without conversion.
Events dated after your real data end, such as scheduled renewals, extend the timeline and make recent periods look finished. Use the last-date setting to cut them off.
Up to 36 periods are computed. Cohorts that are older than that still appear, but their later periods are not in the table.
Common errors and how to fix them
- Every row is reported as having a date that could not be read
- Choose the correct date column. If the dates are free text such as 'last Tuesday' they cannot be parsed; export them as ISO dates (2025-03-09) or Excel dates.
- The table has only one cohort
- That happens when the user column is a constant, or when the chosen unit is too coarse for the date range. Check the user column and try week or day cohorts.
- Everything is blank after period 0
- The data may span only one period of the chosen unit, or all events fall in the unfinished last period. Use a smaller unit or turn on the unfinished-period option.
Best practices
- Report cohort size next to every percentage, and avoid reading anything into cohorts under about 30 users.
- Compare the same period offsets across cohorts, such as week 4 for every cohort, rather than the latest cell of each row, because the latest cells sit at different ages.
- When comparing two exports, use the same period unit and the same last-date cutoff for both; a weekly triangle and a monthly one cannot be read side by side.
Why the unfinished period is handled separately
Suppose your data ends on Wednesday and you group by Monday-start weeks. The final week has three days of activity at most, so every cohort's most recent cell would be low, and the cohort that began that week would show retention in week 0 only. A reader sees a cliff at the right-hand edge that is not in the product at all.
The default here is to drop that unfinished week from the analysis and say so. Switching the option on keeps it, but the cells are marked and kept out of the averages, so the weighted average at a given offset only ever uses completed periods. For day cohorts nothing is ever unfinished, because a day with any event is a whole day in the data.
Reading the weighted average
The average row is not the mean of the percentages above it. A cohort of 400 users and a cohort of 20 would contribute equally to a plain mean, which lets small groups steer the result. The weighted average adds the retained users and divides by the combined cohort sizes, so it is the retention of the pooled group.
Each offset uses a different set of cohorts, since newer cohorts have not reached later offsets yet. The curve therefore describes older users more than recent ones at its right end. When the right end looks better or worse than expected, check how many cohorts contribute by looking at which rows still have a value in that column.
Frequently asked questions
What is the difference between classic and rolling retention?
Classic counts a user in period N only if they did something in period N. Rolling counts them if they did something in period N or any later period, so it measures users who have not churned yet. Rolling is never lower than classic for the same cell.
Why are some cells grey instead of 0%?
Those periods have not happened yet for that cohort, given the last date in your data. A zero would claim the users did not return, which is not known.
Is my event data uploaded?
No. The file is parsed and the table is built in this browser tab. The only thing downloaded to the page is the code that runs it, and the spreadsheet library used for XLSX export loads when you press that button.
Can I get lifetime value?
Choose a revenue column and switch the table to Cumulative revenue per user. It is revenue to date divided by the cohort size, not a prediction of future spend.