RFM Analysis & Customer Segmentation

Unlock customer insights with RFM analysis: segment customers by recency, frequency, and monetary value to boost loyalty, retention, and targeted marketing strategies.

Alex JostAlex Jost
Founder of RetentionX · Feb 4, 2025 · 13-minute read

What is RFM Analysis?

❝

RFM analysis is a business metric that measures the value of customer relationships. RFM stands for recency, frequency & monetary. It looks at how recently a Shopify customer has made a purchase (recency), how often they make purchases (frequency), and how much they spend per purchase (monetary).

RFM analysis can your brand identify your best customers and focus your marketing campaigns on retaining and growing these relationships. When used correctly, RFM analysis can be an valuable tool for increasing customer loyalty and lifetime value.

Key takeaways
1
RFM analysis scores every customer on Recency (days since last order), Frequency (number of orders) and Monetary value (net spend), then combines the three scores into one RFM code such as 111 or 444.
2
Scores are relative: customers are ranked against each other and split into equal groups (quartiles here), not judged against fixed thresholds.
3
In this guide 1 is best and 4 is worst, so 111 = top customers and 444 = least valuable.
4
RFM segmentation turns scores into actionable groups (Top, Loyal, High Potential, Dormant…) with a different campaign for each.
5
Shopify doesn’t calculate RFM natively. You can build it from an order export in a spreadsheet, or use a tool that keeps it updated.
In this post
01What is RFM analysis?→
02RFM analysis example and formulas→
03Customer segmentation using RFM→
04RFM segments action chart→
05How to do RFM analysis in Shopify→
06FAQ→

RFM analysis provides valuable customer insights, enabling businesses to make informed marketing decisions by analyzing customer cohorts, visualizing RFM data, and leveraging customer behavior information.

Why is RFM segmentation important for customer retention for brands on Shopify?

By integrating RFM analysis into your brand’s strategy, you not only foster better relationships with your customers but also steer your Shopify store towards a path of sustainable growth. It brings a data-driven approach to understanding customer behavior – based on recency, frequency and monetary value, helping to refine marketing strategies and make informed business decisions. This, in turn, enhances the overall health and profitability.

  • Better Customer Segments: Personalization allows for targeted and personalized marketing campaigns, enhancing customer experience and fostering brand loyalty. Identifying and targeting repeat customers is crucial for refining customer segments, as it helps in recognizing those who contribute significantly to your business through frequent purchases. This approach aids in the efficient allocation of marketing resources by focusing on cohorts of customers that are more likely to respond positively.

  • Improve Customer Lifetime Value: Knowing the LTV helps in budgeting, marketing, and understanding customer behavior.

  • Increase Customer Retention: By segmenting Shopify customers based on their customer lifetime value, companies can craft personalized strategies to retain high-value customers and improve the value of lower-value customer segments.

  • Better Cost Efficiency: By segmenting customers based on their customer lifetime value, companies can craft personalized strategies to retain high-value customers and improve the value of lower-value customer segments.

  • Enhanced Product Development: By segmenting customers based on their LTV, companies can craft personalized strategies to retain high-value customers and improve the value of lower-value customer segments.

– Shopify does not provide RFM analysis & RFM segmentation out of the box. RetentionX adds this functionality.

Understanding RFM segmentation: The RFM Model

Recency (R)

  • Definition: Measures the time since a customer's last purchase.

  • Importance: Identifying recent customers can help you retain them, as a client who recently made a purchase is more likely to buy again compared to one who hasn't bought anything for a long time.

Frequency (F)

  • Definition: Reflects how often a customer buys from your store.

  • Importance: Clients who purchase frequently are generally more engaged and potentially more loyal, indicating a stronger likelihood to respond to new offerings or promotions.

Monetary (M)

  • Definition: Represents the total money (net revenue after returns) a customer has spent in your store.

  • Importance: Shopify customers who have spent a higher amount are often more valuable to your business, providing insights into customer segments that might be more receptive to upselling or cross-selling opportunities.

RFM Analysis Example

Let’s take a look at the sample data set below including 12 different customers. Analyzing this data set can offer valuable repeat customer insights, helping to understand customer behavior trends over time.

Step 1: Sort your customers according to the RFM factors

First of all, we need to calculate per customer how many days have passed since the last order (Recency), how many orders they have placed (Frequency), and the monetary value they generated. We recorded this information in the following table:

Step 1 · Sample data
12 customers, three numbers each.
Days since last order, number of orders and total spend per customer.
CustomerRecency (days)Frequency (orders)Monetary (total)
1126$47
221$38
3333$320
41072$900
52610$43
6503$549
715$125
839$250
9741$73
10220$1,700
1197$185
12418$310

Step 2: Score each customer according to position

To conduct RFM analysis for this example, let’s see how we can score these customers by ranking them based on each RFM factor separately. Let’s begin with ranking customers on recency first and score all customers from 1-4.

As seen in the table below, we have sorted customers by recency, with the most recent purchasers at the top. Once the numbers are sorted, you will separate your customer data into quartiles, 4 equal groups of 25%. The top 25% of customers (customers 7, 2, 10) receive a recency score of 1, the next 25% (the next 3 customers 8, 11, 1) a score of 2, and so on. These recency scores are summarized below:

Step 2 · Recency score
Sort, then split into quartiles.
Most recent buyers first. Each group of 25% gets one score, 1 = best.
CustomerRecency (days)R score
Top 25% · 1st quartile
711
221
1021
26–50% · 2nd quartile
832
1192
1122
51–75% · 3rd quartile
5263
3333
12413
Worst 25% · 4th quartile
6504
9744
41074
Frequency and monetary value are scored the same way: the top 25% get a 1, the bottom 25% a 4.

Similarly, we can then sort customers by frequency from most to least frequent, assigning the top 25% a frequency score of 1, etc. For the monetary value, the top 25% of customers will be assigned a score of 1 and the lowest 25% a score of 4.

❝

The RFM analysis is always a relative analysis that compares customers against each other. No thresholds are defined for assigning a score to a customer.

Step 3: Determine the RFM score

After we have sorted and assigned scores to each factor, you will be able to determine each customer's RFM score by combining each individual score as seen in the last column below:

Step 3 · RFM score
Three digits, one customer.
Combine the R, F and M scores. 111 is your best customer, 444 your weakest.
IDRec.
days
RFreq.FMon.MRFM
112262$474224
22114$384144
333333$3202332
4107424$9001441
5263101$434314
650433$5491431
71153$1253133
83291$2502212
974414$733443
1021201$1,7001111
119272$1853223
1241382$3102322
Customer 10 scores 111: bought 2 days ago, 20 orders, $1,700. Customer 9 scores 443: 74 days, one order, $73.

Fantastic! Now we've completed the analysis.

Performing this analysis manually not only demands a considerable investment of time and resources but also bears the risk of human errors that can skew insights and lead to misguided strategies. Moreover, the dynamic nature of customer data requires constant updating and refinement. RetentionX can automate this process, continuously updating the data to provide real-time insights.

How to calculate RFM scores in a spreadsheet

If you want to reproduce the example on your own data, one row per customer is enough. Assume column C holds the last order date, D the number of orders and E net revenue:

  • Recency (days): =TODAY()-C2, stored in column F.

  • R score (fewer days = better = 1): =IF(F2<=QUARTILE(F$2:F$5000,1),1,IF(F2<=QUARTILE(F$2:F$5000,2),2,IF(F2<=QUARTILE(F$2:F$5000,3),3,4)))

  • F score (more orders = better = 1): =IF(D2>=QUARTILE(D$2:D$5000,3),1,IF(D2>=QUARTILE(D$2:D$5000,2),2,IF(D2>=QUARTILE(D$2:D$5000,1),3,4)))

  • M score: same formula as F, applied to column E.

  • RFM code: =G2&H2&I2, combining the three scores into a code like "112".

❝

Worked example: a customer who last ordered 12 days ago, has placed 6 orders and spent $540 lands in the best quartile on all three if most of your customers bought longer ago, ordered fewer times and spent less. Their RFM code is 111. A customer who ordered once, 300 days ago, for $35 will usually come out at 444.

One practical note: in many stores most customers have exactly one order, so frequency quartiles collapse. If that happens, use fixed frequency buckets (1, 2, 3–4, 5+ orders) instead of quartiles.

Customer Segmentation Using RFM to Enhance Customer Lifetime Value

After ranking our customers based on the recency, frequency, and monetary, we have individual R, F, and M scores; by combining their individual R, F, and M scores, we get the aggregated RFM score per customer.

Up to 64 different combinations of RFM scores are possible. However, to help you get started, we recommend the following predefined RFM statuses:

  • Top Customers – RFM score of 111:Most valuable customers: made the highest amount of purchases, with the least days since last order and the highest monetary value. Often also called VIP Customers or Champion Customers

  • Loyal Customers – RFM score of X1X:Customers that made a great number of purchases. This segment does not indicate performance regarding days since the last order or monetary value.

  • High Potentials – RFM score of XX1:Customers that made had a great AOV along their lifecycle. This segment does not indicate performance regarding days since the last order or number of orders in their lifecycle.

  • Small Buyers – RFM score of X13 or X14:Customers that place few orders will have a small monetary value. This segment does not indicate performance regarding days since the last order.

  • Dormant Customers – RFM score of 44X:Customers that placed few orders a long time ago. This segment does not indicate performance regarding the monetary value of those orders.

  • Worst Customers –RFM score of 444:Customers that placed few orders, a long time ago, with small monetary value.

  • Other:Customers who do not fall under the specifications above will be categorized as Other. All shopify customers are assigned an RFM score; however, not all scores have a predefined RFM status. You can create custom segments based on the RFM scores using our segment builder!

Once every customer has an RFM Score assigned, it is time to see the percentage of your database that belongs to each group. In this report, you will be able to see how many customers (both in absolute numbers and percentages) are within each score combination - that will give a look over your customer base's health!

Strategy Development and Implementation for VIP Customers

Instead of analyzing your entire customer base as a whole, RFM analysis is a powerful tool to segment customers into homogeneous groups, understand the traits of each group, and engage them with relevant campaigns. By knowing your customer distribution per RFM, you can identify and address potentials and risks in your customer structure:

  • Top Customers: Reward most valuable customers with unexpected benefits

  • Loyal Customers: Provide the highest level of customer service to transform them into Top Customers

  • Top Customers: Encourage them to place the next order, e.g. by using vouchers or goodies

  • High Potentials: Offer other relevant products and special discounts

  • Small Buyers: Reactivate them by an explicit reconnection

  • Worst Customers: Revive the interest of lost customers with a reach-out campaign, otherwise ignore them

Before you put a rewards budget behind your Top Customers, check whether rewards change their behavior or just pay customers who were already loyal. That is the core of measuring loyalty program ROI.

To do so, create segments and identify all customers belonging to an RFM status, e.g. all your Top Customers.

Alternatively, you can segment customers with our one-click segmentation suggestions.

❝

Independent of our predefined RFM statuses, you can define your own RFM segmentation. When creating a new customer segment, simply combine the individual RFM scores as needed.

You can also use RFM to better acquire new customers by creating lookalike audiences of your top customer segments.

Before you size a VIP budget, check how concentrated your revenue is. If your top 1% of customers bring in a quarter of revenue, those few hundred people need their own plan. Here is how to measure customer concentration by percentile band.

With the help of RetentionX's built-in integrations to all marketing channels, you can synchronize segments to Meta, Google, Tiktok, Klaviyo (email marketing) and many other platforms to either acquire similar new customers or target and reactivate your existing customer segments.

RFM segments and what to do with each: action chart

Most RFM guides stop at the definition of each segment. This chart adds what to send, what to avoid and which number tells you whether it worked. Codes follow this guide's convention (1 = best, 4 = worst; X = any score).

RFM action chart
What to do with each RFM segment.
Codes follow this guide’s convention: 1 = best, 4 = worst, X = any score.
SegmentWhat to do
Top Customers111 · recent, frequent, high spendUnexpected perks, early access, new-product previews.Avoid: blanket discounts — they buy anyway
Watch: share still 111 next month
Top Customers going quiet3–4 1 1 · past their usual reorder timePersonal reach-out first, then a targeted incentive.Avoid: waiting until they are fully dormant
Watch: reactivation within 30 days
Loyal CustomersX1X · order often, spend variesBundles and cross-sells to lift basket size; best-in-class service.Avoid: treating them like Top Customers on spend
Watch: AOV, items per order
High PotentialsXX1 · high spend, few ordersThe right next product, timed to the median reorder gap.Avoid: generic newsletters
Watch: 2nd- and 3rd-order rate
Small BuyersX13, X14 · few orders, low spendReconnect with bestsellers, reviews and a reason to come back.Avoid: deep discounts that train price sensitivity
Watch: contribution per reactivated customer
Dormant Customers44X · few orders, long agoOne win-back sequence, then lower send frequency.Avoid: mailing them as often as active customers
Watch: win-back rate, list health
Worst Customers444 · one small order, long agoA last reach-out campaign, otherwise suppress.Avoid: acquisition-level budgets to revive them
Watch: cost per reactivation
A starting point, not a benchmark. For the levers behind these moves, see Ways to Increase LTV.
Part 2 · Do it yourself

How to do RFM analysis in Shopify, step by step

  1. Export customers and orders. Shopify's customer export includes total orders and total spent per customer. Add the last order date from an orders export.

  2. Use net revenue. Subtract refunds and returns before scoring Monetary, otherwise serial returners look like VIPs.

  3. Score R, F and M with the spreadsheet formulas above and build the RFM code.

  4. Map codes to segments using the RFM statuses in this guide (Top Customers 111, Loyal X1X, High Potentials XX1, Dormant 44X and so on).

  5. Recreate the segments in Shopify. The customer segment editor can approximate them with filters such as last_order_date, number_of_orders and amount_spent, or you can tag customers via import.

  6. Run one campaign per segment and re-score monthly. RFM codes drift as customers age, and a Top Customer who goes quiet is your most valuable reactivation target.

RFM analysis vs. cohort analysis

RFM and customer cohort analysis answer different questions. RFM is a snapshot: who are my best and most at-risk customers right now? Cohorts are a trend: are customers acquired this quarter behaving better or worse than last quarter's? Use cohorts to judge acquisition quality and RFM to decide who gets which message. Both feed into customer-based revenue forecasting, where recency and frequency drive the expected value of every customer.

Common RFM segmentation mistakes

  • Mixing up score directions. Some tools score 5 as best, others (like this guide) 1 as best. Check before comparing reports.

  • Ignoring the purchase cycle. 60 days since last order is alarming for coffee and normal for furniture. Read recency against your replenishment time.

  • Scoring on gross revenue. Returns and discounts distort Monetary.

  • Treating every 111 the same. A handful of customers can carry a large share of revenue. Check your customer concentration and look at who your VIPs actually are.

  • Scoring once. RFM is only useful if it is refreshed regularly.

FAQ: RFM analysis and RFM segmentation

What does RFM stand for?
RFM stands for Recency, Frequency and Monetary value. Recency is how many days have passed since a customer's last order, frequency is how many orders they have placed, and monetary value is how much they have spent in total, ideally net of returns. Together the three describe how engaged and valuable a customer is.
How is an RFM score calculated?
Rank all customers on each factor separately and split them into equal groups, such as quartiles. Each customer gets a score per factor, for example 1 to 4, where 1 is the best group in this guide. Combining the three scores gives an RFM code like 111 (best) or 444 (least valuable).
What is RFM segmentation?
RFM segmentation groups customers by their RFM codes into segments you can act on, such as Top Customers, Loyal Customers, High Potentials, Dormant Customers and Small Buyers. Each segment gets its own strategy: rewards for top customers, cross-sells for high potentials, reactivation for dormant customers.
How do you interpret RFM scores?
Read each digit separately. A strong recency score with a weak frequency score is a new or occasional buyer worth nurturing. A weak recency score with strong frequency and monetary scores is a valuable customer who has gone quiet and should be reactivated quickly. Because scores are relative, always interpret them within your own customer base.
Does Shopify have built-in RFM analysis?
Not as a ready-made RFM report. Shopify's customer segment editor lets you filter by last order date, number of orders and amount spent, so you can approximate RFM segments. For true quartile-based scoring that updates automatically, you need a spreadsheet workflow or a dedicated analytics tool.