Real-world recipes · Product analytics

Retention by signup cohort

In Excel, you'd reach for
fxThe cohort triangle, built by hand with COUNTIFS

A cohort is everyone who signed up in the same month. Retention asks: of each cohort, how many were still logging in 1, 2, 3 months later?

Step one tags each login with how many months after signup it happened. Step two counts distinct people per cohort and month offset.

Try itEdit the query, then Run
cohortmonth_0month_1month_2month_3
2026-0143373230
2026-0243373427
2026-0365595551
2026-045343390
2026-05776800
2026-0670000

6 rows

Turning year and month into "number of months since year zero" makes the subtraction easy. Later cohorts have empty months simply because those months haven't happened yet in the data.

Your turn

Cohort sizes: how many customers signed up each month? Columns cohort and customers, in order.

This page on one card

Retention by signup cohort: the Excel way (The cohort triangle) and the SQL query, side by side
Retention by signup cohort, on one card: the Excel way and the SQL. Download · Save to Pinterest
The practice data (7 tables)

See every column and sample rows