· 12 min read

RFM Analysis for Ecommerce: Segments That Pay (2026)

RFM analysis for D2C brands, scored on margin and your repurchase cycle. A Google Sheets method, 10 segments and what each one gets, with rupee examples.

RFM analysis for ecommerce: score customers on recency, frequency and margin, then give each segment a channel, an offer ceiling and a suppress rule

Updated October 2026.

RFM analysis scores every customer on recency (how recently they bought), frequency (how often) and monetary value (how much they're worth), then groups them so you can decide who gets which message, on which channel, at what discount. For a D2C brand, the useful version measures recency against your own repurchase cycle and uses margin instead of spend for the M.

I've split customer bases this way at HealthifyStore and for a D2C brand I worked with, where we sent one monsoon email across 10 RFM segments. This guide covers how to score, a Google Sheets method from an order export, and the part most explainers skip, which is what each segment should actually receive.

What is RFM analysis in marketing?

RFM is a way of ranking customers by behaviour you already have in your order data. Each customer gets three scores, usually from 1 to 5.

  • Recency. Days since the last order. Lower is better, so the most recent buyers score 5.
  • Frequency. Number of orders. More is better.
  • Monetary. What the customer has been worth. Most guides use total spend. I use margin, for reasons below.

A 5-4-4 bought recently, often, and is worth more than most. A 1-1-2 bought once, long ago. Grouping the codes gives you segments such as champions, at risk or lost.

RFM is a sorting method. It's useful because the inputs are cheap and the logic is easy to explain to a founder. It isn't scientifically proven to predict anything for your brand, and the only way to know whether your segments earn money is to test them against a holdout. The global control group post covers how.

Why RFM matters for a D2C brand

Most of a D2C brand's customers buy once. At HealthifyStore, most customers bought once. The one in eight who came back brought in more than three times their share of revenue, and customers with five or more orders were a sliver of the base but about a sixth of revenue.

That shape is why one blast to the whole list wastes money. The small group that drives revenue gets the same discount as people who were never coming back. RFM is the cheapest way to see that split and act on it. It sits at the centre of retention marketing, because every journey and campaign starts with deciding who it's for.

The first thing I check before scoring is total audience against reachable audience. If only 20 of every 100 customers can be reached on WhatsApp, your WhatsApp segments are a fifth of the size the sheet says. Score everyone, then count reachable customers per channel.

How to calculate RFM scores

There are two ways to score. Pick based on how your data is shaped.

Quintiles. Sort customers on each measure and cut into five equal groups. The top 20% on recency get R5, and so on. This works for monetary value and is the textbook method.

Simple rules. Set the bands yourself. This works better for recency and frequency in D2C, because when most customers have one order, the bottom three frequency quintiles all hold the same people. Use rules for F (1 order, 2, 3, 4 to 5, 6 or more) and quintiles only where the data is spread out.

Set the recency window from your purchase cycle

A 90-day window means something very different for a protein powder and for a mattress. So start with the median gap between a customer's first and second order. Your cohort analysis will give you this, or you can calculate it from the same order export.

Say your median gap is 30 days. Recency bands become multiples of that cycle.

Recency score Days since last order
5 0 to 30 (one cycle)
4 31 to 60
3 61 to 90
2 91 to 180
1 Over 180 (six cycles plus)

A brand with a 120-day gap scores R5 up to 120 days. Either way, the score means how far a customer is from when they'd normally buy again.

Recency matters most of the three. On one email for the D2C brand I worked with, buyers from the last 15 days clicked about six times as often as buyers from over 180 days ago, while opens barely moved. On WhatsApp, buyers from the last 15 days converted many times better than the broad blast.

Use margin for M, not spend

Spend tells you who paid you. Margin tells you who earned you money, which is the question behind customer profitability.

Say a brand sells a ₹1,770 order (₹1,500 plus GST). After product cost, shipping, returns and the payment fee, it keeps ₹844 per full-price order. That's its CM2, worked through in the CM1, CM2, CM3 guide.

Two customers have each spent ₹6,000.

Item Customer A Customer B
Orders 4 at full price, ₹1,500 each 5 at 20% off, ₹1,200 each
CM2 per order ₹844 About ₹550
Total CM2 ₹3,376 About ₹2,750

On spend, B looks better, with the same M and a higher F. On margin, A is worth about ₹600 more, and B has learned to wait for a code. If you can't get cost per order, multiply revenue by your average CM2 percentage per category. It's rough, but it still separates a discount-led customer from a full-price one.

It's the same reason a "good" LTV to CAC ratio on revenue can still lose money.

RFM analysis in Google Sheets, step by step

You need one order export, ideally 12 to 24 months. If your export has one row per line item, collapse it to one row per order first.

  1. Build an Orders tab. Keep five columns. A is the order ID, B the customer (email or phone), C the order date, D net revenue excluding GST and after discounts, and E the order's margin. Add F as "Y" if a discount code was used.
  2. Roll up to one row per customer. In a new tab, use =QUERY(Orders!A:E,"select B, max(C), count(A), sum(D), sum(E) where B is not null group by B",1). This gives last order date, order count, revenue and margin per customer in columns A to E.
  3. Add days since last order. Put the export date in L1. In F2, use =$L$1-B2 and fill down.
  4. Score recency from your cycle. Put your median repurchase gap in K1. In G2, use =IF(F2<=$K$1,5,IF(F2<=2*$K$1,4,IF(F2<=3*$K$1,3,IF(F2<=6*$K$1,2,1)))).
  5. Score frequency with rules. In H2, use =IF(C2>=6,5,IF(C2>=4,4,C2)). Three orders score 3, two score 2, one scores 1.
  6. Score margin by quintile. In I2, use =1+(E2>PERCENTILE(E$2:E,0.2))+(E2>PERCENTILE(E$2:E,0.4))+(E2>PERCENTILE(E$2:E,0.6))+(E2>PERCENTILE(E$2:E,0.8)).
  7. Name the segment. In J2, use =IFS(AND(G2>=4,H2>=4),"Champions",AND(G2<=2,H2>=4),"Can't lose them",AND(G2>=3,H2>=3),"Loyal",AND(G2>=4,H2=2),"Potential loyalists",G2>=4,"Recent",G2=3,"Needs attention",G2=2,"About to sleep",H2>=2,"Hibernating",TRUE,"Lost").
  8. Flag price-sensitive customers. Count each customer's orders with a code. Anyone whose orders mostly used one gets a "price sensitive" flag on top of their segment.
  9. Pivot and refresh. Count customers and sum margin per segment. Re-run the export every month, or every week if you send weekly.

Take a customer whose last order was 22 days ago, with 3 orders and ₹2,532 in margin, which sits between the 60th and 80th percentile of the base. With a 30-day cycle they score R5, F3, M4, and the formula puts them in Loyal.

RFM segmentation: 10 segments and what each one gets

A segment that ends in a label hasn't done any work. Each one needs a decision on channel, message, offer ceiling, frequency and when to stop. Here are the 10 segments we used on the monsoon send, with the rules from the sheet above.

Segment R and F Channel and message
Champions R4 to 5, F4 to 5 WhatsApp and email. Early access, launches, no code
Loyal R3 to 5, F3 and up Email first. The next product in their sequence
Potential loyalists R4 to 5, F2 WhatsApp. The product that leads to order three
Recent R4 to 5, F1 Post-purchase flow. How to use it, then what's next
Needs attention R3, F1 to 2 Email. A reminder tied to what they bought
About to sleep R2, F1 to 3 Email, then one WhatsApp if M is 3 or more
Can't lose them R1 to 2, F4 to 5 WhatsApp, personal and specific to their history
Hibernating R1, F2 to 3 Email only. Seasonal or new-range news
Lost R1, F1 Email only. One win-back sequence
Price sensitive A flag on any segment Sale windows and threshold codes

The message column comes from what they bought. For buyers of a consumable, it's a replenishment reminder a few days before they'd run out. For buyers of a one-time product, it's the refill or add-on that follows. The replenishment and cross-sell post covers how to map that sequence.

Offer ceilings, frequency caps and suppress rules

The offer ceiling is the most a segment can be given, capped as a share of one order's CM2. Using the ₹844 CM2 from earlier, the logic is simple. A discount to someone who'd buy anyway is pure loss. A discount to someone who wouldn't buy is a cost of winning an order.

Segment Offer ceiling Frequency cap Suppress when
Champions ₹0 2 a week Any automation in the last 3 days
Loyal Free shipping at most 2 a week Any automation in the last 3 days
Potential loyalists ₹100 (about an eighth of CM2) 2 a week Order placed or return open
Recent ₹0 for the first 2 weeks Post-purchase flow only Out of sale blasts until delivered
Needs attention ₹150 1 a week No click in 4 sends
About to sleep ₹200 1 a week No click in 4 sends
Can't lose them ₹250 (under a third of CM2) 1 a week 2 unanswered WhatsApps
Hibernating ₹200 2 a month No open in 3 sends
Lost ₹250, once The win-back only Sequence ends without a click
Price sensitive Threshold code, "spend ₹2,500, get ₹250 off" Sale windows Out of full-price launches with codes

The three-day rule is one I use to protect WhatsApp delivery. Anyone who got an automated message in the last three days stays out of broadcasts. Over-messaging is what drags WhatsApp delivery rates down, and a frequency cap per segment is how you stop it.

Then test inside each segment. On the monsoon send, a specific, urgent subject line beat a sentimental one in every one of the 10 segments, from champions to lost. More on that in the ecommerce email subject lines post.

If you don't have orders, use engagement

Before I had order-level segments, I used engagement. At Zymrat, we split the email list into three groups by what people did in the last 90 days, and gave each group one job. People who hadn't opened got a subject line built to earn the open. People who had opened got product information to earn the click. People who had clicked got heavier discounts, because they were interested but something was holding them back.

That's RFM in spirit. Each group gets the message that moves it one step.

RFM vs personas vs cohorts

These answer different questions.

Method Groups customers by Answers
RFM Recent behaviour and value Who gets what this week
Personas What they bought first and why What to sell them next
Cohorts When they were acquired Is retention improving over time

Personas catch what RFM misses. For the D2C brand I worked with, a persona analysis found that over half of customers were one-and-done buyers of a single core piece, bringing about a third of revenue. "Big first bet" bundle buyers were under a tenth of customers but about a quarter of revenue, and they rarely returned.

RFM would score those bundle buyers with a high M after one order and treat them as future champions. They weren't. First-order value predicted repeat in an inverted U. Middle-value first orders repeated about twice as often as the cheapest, and the biggest first orders repeated less. So a big first basket earns a thank-you and a care guide, not a champion's treatment.

Cohorts tell you whether any of this is working. Read them month by month, and track the headline number with the customer retention rate formula.

How to segment customers in ecommerce: mistakes to avoid

Scoring M on spend. Discount-led customers look like your best. Use margin, or revenue times CM2 percentage at the least.

A recency window copied from a blog. A 90-day window is wrong for most categories. Set it from your median repurchase gap.

Quintiles on frequency when most customers bought once. The bottom groups end up identical. Use rules.

Segments that end in names. If a segment has no channel, offer ceiling and suppress rule, nobody will act on it.

Discounting champions. They were going to buy. Give them access, not codes.

Reading opens. Apple Mail Privacy Protection inflates opens. Clicks and orders show the recency gradient; opens hide it.

No holdout. Without a control group, you can't tell whether the champions bought because of the message or in spite of it.

Where I fit

Most brands have RFM segments somewhere in their CRM platform. Few have tied them to a recency window, a margin-based M and a rule for what each segment gets. Compound Lab is a retention agency, and setting that up, then turning the segments into journeys, is the work. If you want help with it, book a 30-minute call and we'll score your base from one order export and show you which segment is quietly costing you margin.

FAQ

What does RFM stand for? RFM stands for recency, frequency and monetary value. That's how recently a customer bought, how often, and how much they're worth, ideally measured in margin rather than spend.

What is RFM in marketing? RFM in marketing is a way of scoring customers on recency, frequency and monetary value so you can decide who gets which message, channel and offer.

How is RFM calculated? Each customer gets a 1 to 5 score on recency, frequency and monetary value, using quintiles or set bands. For D2C, set recency bands as multiples of your median repurchase gap, score frequency by order count, and score monetary value on margin.

What is the RFM formula? There's no single formula. The common method is R score plus F score plus M score, each from 1 to 5, read as a three-digit code like 5-4-4.

How to segment customers in ecommerce? Start with an order export, roll it up to one row per customer, and score recency, frequency and margin. Group the scores into segments, then give each segment a channel, a message, an offer ceiling, a frequency cap and a rule for when to stop messaging.

How do you do RFM analysis in Excel? Use a PivotTable on the order export to get each customer's last order date, order count and total margin. Then add IF formulas for recency and frequency scores, a PERCENTILE formula for margin quintiles, and an IFS formula to name the segment. The same formulas work in Google Sheets, and Compound Lab can run it on your data on a 30-minute call.

What are the four types of customer segmentation? The four usually listed are demographic, geographic, psychographic and behavioural. RFM is behavioural segmentation, and for a D2C brand it's the one that predicts the next order best, because it's built on what customers actually bought and when.


Not sure which of your segments is costing you margin? Book a 30-minute call.

Next postSPF, DKIM, DMARC for D2C: Why Emails Go to Spam (2026)

Your customers already paid once. Make them pay again.

Book a Consultation