RFM Analysis
Segment customers by Recency, Frequency, and Monetary value to identify your most valuable customers and optimise marketing strategies.
RFM (Recency, Frequency, Monetary) analysis is a marketing technique used to quantitatively rank and group customers based on their transaction history. Developed in the direct marketing industry decades ago, RFM remains one of the most effective and widely-used segmentation methods because it's simple, actionable, and directly tied to revenue outcomes.
The power of RFM lies in its behavioral foundation. Rather than relying on demographic assumptions or declared preferences, RFM segments customers based on what they've actually done: when they last purchased (Recency), how often they purchase (Frequency), and how much they spend (Monetary). These three dimensions capture the most predictive indicators of future customer behavior and lifetime value.
RFM analysis enables marketers to answer critical questions: Who are my best customers? Who is at risk of churning? Which customers have the highest potential for growth? By scoring customers on each dimension and combining those scores into segments, businesses can tailor marketing strategies, allocate resources efficiently, and maximise customer lifetime value.
| Component | Definition | Measurement | Why It Matters | Scoring |
|---|---|---|---|---|
| Recency (R) | How recently a customer made a purchase | Days since last purchase | Recent customers are more likely to respond to marketing and make repeat purchases | 5 = Most recent, 1 = Least recent |
| Frequency (F) | How often a customer makes purchases | Number of transactions in time period | Frequent buyers demonstrate loyalty and engagement with your brand | 5 = Most frequent, 1 = Least frequent |
| Monetary (M) | How much money a customer spends | Total or average purchase value | High-value customers contribute most to revenue and have highest lifetime value | 5 = Highest spend, 1 = Lowest spend |
| Segment | RFM Score Range | Characteristics | Marketing Strategy | Priority |
|---|---|---|---|---|
| Champions | 555, 554, 544, 545 | Bought recently, buy often, spend the most | Reward them, ask for reviews, upsell premium products | Highest |
| Loyal Customers | 543, 444, 435, 355 | Buy regularly, responsive to promotions | Recommend related products, engage with loyalty programs | High |
| Potential Loyalists | 553, 551, 552, 541 | Recent customers with average frequency and spend | Offer membership programs, recommend products | High |
| Recent Customers | 512, 511, 422, 421 | Bought recently but not frequently | Provide onboarding support, build relationships | Medium-High |
| Promising | 525, 524, 523, 522 | Recent shoppers with moderate frequency | Create brand awareness, offer free trials | Medium |
| Customers Needing Attention | 535, 534, 443, 434 | Above average recency, frequency, and monetary | Make limited-time offers, recommend products | Medium |
| About to Sleep | 331, 321, 312, 221 | Below average recency, frequency, and monetary | Win-back campaigns, special offers | Medium |
| At Risk | 255, 254, 245, 244 | Spent big money, purchased often, but long time ago | Send personalised emails, offer renewals, provide helpful resources | High |
| Can't Lose Them | 155, 154, 144, 145 | Made biggest purchases, but haven't returned for a long time | Win them back via surveys, special offers, personalised outreach | Highest |
| Hibernating | 332, 322, 231, 241 | Last purchase was long ago, low frequency and spend | Offer relevant products, special discounts, reactivation campaigns | Low-Medium |
| Lost | 111, 112, 121, 131 | Lowest recency, frequency, and monetary scores | Revive with aggressive discounts or ignore to reduce costs | Low |
| Step | Description | Example |
|---|---|---|
| 1. Define Time Period | Choose analysis window (typically 12 months for most businesses, shorter for high-frequency purchases) | E-commerce: 12 months, SaaS: 6 months, Grocery: 3 months |
| 2. Calculate Metrics | For each customer, calculate recency (days since last purchase), frequency (number of purchases), monetary (total spend) | Customer A: Recency = 15 days, Frequency = 8 purchases, Monetary = $2,400 |
| 3. Score Each Dimension | Divide customers into quintiles (5 groups) for each metric, assign scores 1-5 | Top 20% recency = 5, next 20% = 4, etc. |
| 4. Combine Scores | Concatenate R, F, M scores to create RFM code (e.g., 543 = R:5, F:4, M:3) | Customer A with scores R:5, F:4, M:5 = RFM code 545 |
| 5. Segment Customers | Group RFM codes into strategic segments based on business logic | 555, 554, 544, 545 = Champions segment |
| 6. Develop Strategies | Create targeted marketing campaigns for each segment | Champions: VIP program, At Risk: Win-back email series |
| 7. Monitor and Iterate | Track segment migration, campaign performance, and adjust strategies | Track how many 'At Risk' customers move to 'Loyal' after win-back campaign |
-- Calculate RFM metrics for each customer
WITH rfm_metrics AS (
SELECT
customer_id,
DATEDIFF(CURRENT_DATE, MAX(order_date)) AS recency,
COUNT(DISTINCT order_id) AS frequency,
SUM(order_total) AS monetary
FROM orders
WHERE order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 12 MONTH)
GROUP BY customer_id
),
-- Score each dimension using NTILE for quintiles
rfm_scores AS (
SELECT
customer_id,
recency,
frequency,
monetary,
-- Lower recency is better, so reverse the score
6 - NTILE(5) OVER (ORDER BY recency) AS r_score,
NTILE(5) OVER (ORDER BY frequency) AS f_score,
NTILE(5) OVER (ORDER BY monetary) AS m_score
FROM rfm_metrics
)
-- Combine scores and assign segments
SELECT
customer_id,
recency,
frequency,
monetary,
r_score,
f_score,
m_score,
CONCAT(r_score, f_score, m_score) AS rfm_code,
CASE
WHEN CONCAT(r_score, f_score, m_score) IN ('555','554','544','545') THEN 'Champions'
WHEN CONCAT(r_score, f_score, m_score) IN ('543','444','435','355') THEN 'Loyal Customers'
WHEN CONCAT(r_score, f_score, m_score) IN ('553','551','552','541') THEN 'Potential Loyalists'
WHEN CONCAT(r_score, f_score, m_score) IN ('155','154','144','145') THEN 'Can\'t Lose Them'
WHEN CONCAT(r_score, f_score, m_score) IN ('255','254','245','244') THEN 'At Risk'
WHEN CONCAT(r_score, f_score, m_score) IN ('331','321','312','221') THEN 'About to Sleep'
WHEN CONCAT(r_score, f_score, m_score) IN ('111','112','121','131') THEN 'Lost'
ELSE 'Other'
END AS segment
FROM rfm_scores
ORDER BY r_score DESC, f_score DESC, m_score DESC;| Technique | Description | Use Case |
|---|---|---|
| Weighted RFM | Assign different weights to R, F, M based on business priorities | SaaS companies might weight Recency higher than Monetary for engagement focus |
| RFM with Additional Variables | Add dimensions like product category, channel preference, or engagement score | RFME (adding Engagement) for content-heavy businesses |
| Predictive RFM | Use machine learning to predict future RFM scores and segment migration | Identify customers likely to churn before they show behavioral signals |
| Dynamic Scoring | Adjust scoring thresholds based on seasonality or business changes | Retail businesses adjusting for holiday shopping patterns |
| Channel-Specific RFM | Calculate separate RFM scores for different channels (online, in-store, mobile) | Omnichannel retailers understanding cross-channel behavior |
1. Choose the Right Time Window
The analysis period should match your purchase cycle. High-frequency businesses (grocery, fast food) use shorter windows (3-6 months), while low-frequency businesses (furniture, cars) use longer windows (12-24 months). Test different windows to find what best predicts future behavior.
2. Adjust for Business Model
Subscription businesses might replace Frequency with "months subscribed" and Monetary with "MRR." B2B companies might weight Monetary higher than Frequency. Customize RFM dimensions to match your business model and what drives customer value.
3. Refresh Scores Regularly
Customer behavior changes over time. Recalculate RFM scores monthly or quarterly to keep segments current. Automated scoring pipelines ensure segments stay fresh and campaigns remain relevant.
4. Track Segment Migration
Monitor how customers move between segments over time. Are "At Risk" customers being successfully reactivated? Are "Potential Loyalists" converting to "Champions"? Segment migration metrics reveal campaign effectiveness and customer lifecycle health.
5. Combine with Other Data
RFM is powerful but not comprehensive. Layer in demographic data, product preferences, channel behavior, and engagement metrics for richer segmentation. Use RFM as the foundation and add context for more nuanced strategies.
6. Test and Measure Campaign Impact
Run A/B tests within segments to validate strategies. Does offering discounts to "At Risk" customers improve retention? Do "Champions" respond better to exclusive access or monetary rewards? Let data guide your segment-specific tactics.
7. Align with Customer Lifetime Value
RFM scores should correlate with CLV. Validate that your "Champions" segment actually has the highest lifetime value. If not, adjust your scoring methodology or segment definitions to better align with business outcomes.
Backward-Looking
RFM is based on historical behavior and may not predict future actions for customers whose circumstances have changed. Combine with predictive models for forward-looking insights.
Doesn't Capture Intent
RFM doesn't explain why customers behave as they do. A low-frequency customer might be satisfied but have infrequent need, not low engagement. Supplement with surveys and qualitative research.
New Customer Challenge
New customers lack sufficient history for accurate RFM scoring. Create separate onboarding segments for recent customers until they accumulate enough transaction data.
Product Diversity Issues
Customers buying different product categories may have different RFM patterns. Consider category-specific RFM analysis for businesses with diverse product lines.