A retailer can report rising monthly sales and still be losing the customers it worked hard to acquire. New buyers may be masking weak repeat purchasing. Cohort retention analysis helps uncover this pattern by following customers who made their first purchase in the same period, then measuring how many buy again in later periods. You can build a useful version in Microsoft Excel without expensive analytics software.
This tutorial uses an entirely illustrative dataset and focuses on purchase-based retention, not subscription renewals or website visits. The distinction matters: a customer who does not purchase in a particular month may still be loyal and may return later.
What is cohort retention analysis?
A cohort is a group of customers sharing a starting event. For a retail business, that event is often the first recorded purchase. All customers whose first purchase occurred in January belong to the January acquisition cohort. Their repeat purchases are then observed in February (month 1), March (month 2), and so on.
Unlike an overall repeat-purchase rate, cohort analysis compares groups at equivalent ages. The January cohort’s month-2 performance should be compared with the February cohort’s month-2 performance, not with its month-4 performance. This approach is also used in analytics platforms such as Google Analytics cohort reporting, although GA4 typically groups users by first session rather than first purchase.
The retention formula and a small example
Monthly purchase retention (%) = (Number of distinct customers in the original cohort who purchased during the selected later month ÷ Number of distinct customers in the original cohort) × 100.
Suppose a Bengaluru fashion retailer acquired 100 first-time customers in January. Twenty-eight of those customers placed at least one order in February and 18 placed an order in March. Month-1 retention is 28%, and month-2 retention is 18%. These are separate monthly activity rates; they cannot be added to obtain the share who returned at least once because some customers may appear in both months.
| First-purchase cohort | Cohort size | Month 1 | Month 2 | Month 3 |
|---|---|---|---|---|
| January | 100 | 28% | 18% | 12% |
| February | 80 | 35% | 20% | Not yet observed |
| March | 120 | 25% | Not yet observed | Not yet observed |
All figures above are hypothetical teaching examples, not industry benchmarks. A blank cell means the observation period has not yet finished. It does not mean 0% retention. Notice that February’s month-1 rate exceeds January’s, but that difference alone does not prove a marketing campaign caused the improvement.
Step 1: Prepare your transaction data
Start with one row per completed order, not one row per customer. Your minimum fields are CustomerID, OrderID, OrderDate and NetSales. CustomerID must remain stable across orders. Exclude cancelled orders and decide how to treat refunded transactions before calculating first purchases. Use a consistent timezone and an explicit reporting cut-off date.
| CustomerID | OrderID | OrderDate | NetSales (₹) |
|---|---|---|---|
| C001 | O101 | 05-Jan-2026 | 1,200 |
| C002 | O102 | 18-Jan-2026 | 900 |
| C001 | O103 | 12-Feb-2026 | 750 |
| C003 | O104 | 02-Feb-2026 | 1,500 |
| C002 | O105 | 08-Mar-2026 | 600 |
This five-row example is only for demonstrating Excel columns; the earlier retention table uses a different hypothetical dataset. Convert your data to an Excel Table using Ctrl+T and name it Orders. Confirm OrderDate contains real Excel dates, not text.
Step 2: Create acquisition month, order month and cohort age
In a modern version of Excel, add four calculated columns to the Orders table. The first formula finds each customer’s earliest eligible purchase in the complete dataset. The second and third standardise dates to the first day of the month, which makes grouping reliable.
First purchase date
=MINIFS(Orders[OrderDate],Orders[CustomerID],[@CustomerID])
CohortMonth
=DATE(YEAR([@FirstPurchaseDate]),MONTH([@FirstPurchaseDate]),1)
OrderMonth
=DATE(YEAR([@OrderDate]),MONTH([@OrderDate]),1)
MonthsSinceFirstPurchase
=12*(YEAR([@OrderMonth])-YEAR([@CohortMonth]))+MONTH([@OrderMonth])-MONTH([@CohortMonth])
A customer whose first purchase was on 5 January and who ordered again on 12 February will have a cohort age of 1 for the February order. Month 0 is the acquisition month. For this tutorial, we report later-month repeat purchase retention, so month 0 is used as the original cohort-size denominator rather than presented as a repeat-retention rate.
Step 3: Count unique customers rather than orders
This is the most important technical check. A customer making three purchases in February counts as one retained customer in February, not three. A simple PivotTable counting OrderID will overstate retention if repeat buyers place multiple orders.
For Excel with the Data Model available, select the Orders table, choose Insert → PivotTable, and tick Add this data to the Data Model. Place CohortMonth in Rows, MonthsSinceFirstPurchase in Columns, and CustomerID in Values. Change the value-field calculation to Distinct Count. Microsoft documents date grouping in PivotTables; using explicit month columns also avoids many date-grouping issues.
If Distinct Count is unavailable in your Excel edition, create a customer-month summary with Power Query: retain CustomerID, CohortMonth and OrderMonth; remove duplicates on those three fields; calculate MonthsSinceFirstPurchase; then build a PivotTable counting rows. This yields one record per customer per month. Keep a separate unique customer-to-cohort table for the denominators.
Step 4: Turn counts into retention percentages
For each cohort, the denominator is the distinct count of customers who first purchased in its acquisition month. Divide each later month’s distinct customer count by that fixed denominator. For example, if a PivotTable shows 28 unique February purchasers from the January cohort and 100 unique January-acquired customers, the month-1 rate is 28/100 = 28%.
In a summary table where B2 contains the cohort size and C2 contains the month-1 unique purchaser count, use:
=IFERROR(C2/$B2,0)
Format the cell as Percentage and copy across. Only use this formula for completed and observable months. Future or incomplete periods should be left blank, not filled with zero. If the original cohort size is genuinely zero, investigate the data rather than interpreting a calculated 0%.
Step 5: Build a cohort heatmap and interpret it
Select the retention percentages and apply Home → Conditional Formatting → Colour Scales. A heatmap makes it easier to see whether newer cohorts retain better than older ones at the same age. Compare the same month offset across rows, and check the cohort size before drawing conclusions.
- Weak month-1 retention: Examine onboarding, delivery experience, product satisfaction and whether the purchase category naturally has a long replenishment cycle.
- Improving later cohorts: Investigate changes in acquisition channels, customer mix and pricing; improvement is an association, not proof of causality.
- Sudden drop in one cohort: Check data completeness, stockouts, seasonal demand and changes in customer identifiers before assuming a real behavioural shift.
- Small cohorts: Show the denominator alongside the percentage. A movement from two to four repeat buyers can look dramatic but may be unstable.
Common mistakes that make cohort analysis misleading
- Counting orders or revenue instead of distinct customers when the metric is customer retention.
- Comparing an older cohort’s fourth month with a newer cohort’s first month.
- Treating unobserved future months as 0% or including a partial current month without warning.
- Calculating first purchase from a truncated dataset and mistakenly classifying established customers as new.
- Combining subscription retention, website activity and purchase retention under one undefined metric.
- Assuming retention improvements are caused by a promotion without considering customer selection, seasonality and other factors.
How a business can use the findings
Imagine an online apparel seller sees stronger first-month repeat purchasing among customers who bought everyday essentials than among occasion-wear buyers. The immediate response should not be to label occasion-wear customers disloyal. Their purchase frequency may simply be lower. Compare cohorts within product categories, acquisition channels and first-order value bands. Then test suitable interventions, such as useful post-purchase care content, replenishment reminders for relevant products or improved service recovery.
For more marketing context, read product line and product mix decisions. For the operational causes of delayed delivery and customer dissatisfaction, see the input–transformation–output model. Researchers extending the analysis into explanatory models may also consult the site’s SEM interpretation guide; descriptive cohort tables alone do not establish causal pathways.
Frequently asked questions
Is cohort retention the same as customer churn?
No. A month without a retail purchase does not necessarily mean permanent customer loss. In a subscription business, churn can have a clearer contractual meaning. Define the activity and observation window before calculating either measure.
What is a good cohort retention rate?
There is no universal percentage that applies across apparel, grocery, software subscriptions and durable goods. Compare like-for-like products and cohorts with similar observation windows and purchasing cycles.
Can I calculate cohort analysis in Excel without Power BI?
Yes. Excel Tables, MINIFS, helper columns, PivotTables and, where needed, Power Query are sufficient for many small and medium datasets. For larger datasets or recurring automated reporting, a database or BI tool may be more convenient.
Further reading
- Google Analytics: Cohort specification and retention calculations
- Microsoft Support: Group data in PivotTables
- Shopify: Cohort retention analysis and business applications
Editorial note: The transaction records and percentages in this guide are illustrative. They are not observations from a real retailer. Formula availability and menu labels can vary by Excel version.
If this article helped, tap Like below to let me know.
Discover more from Mythic
Subscribe to get the latest posts sent to your email.
