Skip to content

RFM Analysis: How to Segment Customers Using Purchase Data

Discover how to turn customer transaction data into actionable segments using RFM analysis. Learn the scoring method, explore a worked example, and understand how to apply the results to business decisions.

Published on
Reading time
17 min read
Modern Analytics Dashboard Workspace
In this article13 sections

Businesses collect customer data every time someone places an order, purchases a service, or makes a repeat transaction. However, knowing how much revenue a business generates does not necessarily reveal which customers are most engaged, which are valuable repeat buyers, or which may require attention.

RFM analysis helps answer these questions by evaluating three aspects of customer purchasing behavior: how recently customers purchased, how frequently they purchased, and how much they spent.

Instead of treating every customer the same way, businesses can use these measurements to create meaningful customer segments and make more informed decisions about retention, marketing, and customer engagement.

In this guide, we explain how RFM analysis works, how to calculate RFM scores, and how to turn raw transaction data into actionable customer segments using a practical example.

Key Takeaways

  • RFM stands for recency, frequency, and monetary value.
  • RFM analysis uses historical transaction data to segment customers based on purchasing behavior.
  • Businesses can calculate RFM scores using spreadsheets, analytics software, or suitable no-code tools.
  • Reliable segmentation requires clean data, consistent scoring rules, and appropriate analysis periods.
  • RFM describes historical behavior and should not be treated as a guaranteed prediction of future purchases.

What Is RFM Analysis?

RFM analysis is a customer segmentation technique that evaluates purchasing behavior using three measurable variables: recency, frequency, and monetary value.

The method helps businesses distinguish between customers who purchased recently, those who purchase regularly, and those who contribute substantial revenue.

Unlike segmentation based entirely on demographic characteristics such as age or location, RFM focuses on observed customer behavior.

The three components work together to create a more useful picture of each customer's relationship with a business.

Recency (R): How Recently Did the Customer Purchase?

Recency measures the time elapsed since a customer's most recent qualifying purchase.

For example, a customer who purchased five days ago is more recently active than someone whose last purchase occurred 90 days ago.

A lower raw recency value usually receives a higher RFM score because it indicates more recent activity.

Frequency (F): How Often Does the Customer Purchase?

Frequency measures the number of qualifying purchases a customer makes during a defined observation period.

A customer who completes ten orders within six months demonstrates different purchasing behavior from someone who places only one order during the same period.

Frequency helps businesses identify repeat buyers and understand purchasing habits.

Monetary Value (M): How Much Does the Customer Spend?

Monetary value measures the total amount a customer spends during the selected period, according to a consistently defined revenue calculation.

For example, a customer who spends $1,200 across multiple purchases has a higher monetary value than someone who spends $150.

However, high spending does not automatically mean high profitability. Businesses may need additional information about discounts, acquisition costs, and profit margins.

Together, these measurements form the foundation of RFM customer segmentation. IBM's RFM analysis documentation explains how individual scores can be combined to represent customer purchasing behavior.

Calendar, repeated purchase receipts and payment records illustrating the three components of RFM analysis.
RFM measures how recently, how often, and how much customers purchase.

What Data Do You Need for RFM Analysis?

One advantage of RFM analysis is that it can be performed using relatively simple transaction records.

Businesses do not necessarily need extensive customer profiles or advanced machine learning models to get started. However, they do need reliable transaction data that can be associated with individual customers.

The following fields provide a practical starting point.

Essential data fields for RFM analysis
Data field Purpose Example
Customer ID Identifies individual customers C001
Order ID Identifies distinct purchases ORD-1001
Order date Calculates purchase recency 2026-11-26
Order value Calculates customer spending $120
Order status Helps exclude canceled or invalid orders Completed

Depending on the business, customer records and transaction histories may be distributed across CRM systems, spreadsheets, point-of-sale systems, and e-commerce platforms.

Before performing segmentation, businesses may need to combine data from multiple sources into a consistent transaction dataset.

Additional fields such as refund amounts, product categories, sales channels, and profit margins can provide useful context beyond the core RFM measurements.

How to Do RFM Analysis in 6 Steps

RFM analysis follows a structured workflow that transforms individual transactions into customer-level metrics, scores, and segments.

Step 1: Define Your Analysis Period

Start by selecting an observation period and a reference date.

For example, a retailer might analyze purchases from the previous six months, while a business selling expensive machinery may require several years of transaction history.

The appropriate period depends on the typical purchasing cycle. Using a short observation period for a business with infrequent purchases could incorrectly classify normally active customers as inactive.

Step 2: Collect and Clean Transaction Data

Prepare the dataset before calculating customer metrics.

Important data preparation tasks include:

  • Removing duplicate transaction records.
  • Standardizing customer identifiers.
  • Correcting invalid transaction dates.
  • Excluding canceled orders.
  • Accounting for refunds and returns.
  • Ensuring monetary values use a consistent currency.

When an order contains multiple product rows, avoid counting each row as a separate purchase.

Data quality directly affects the reliability of the resulting customer segments.

Step 3: Aggregate Transactions by Customer

Transaction datasets often contain multiple records for each customer. RFM analysis requires these records to be summarized into customer-level measurements.

For each customer, identify the latest qualifying purchase date, count distinct qualifying orders, and calculate total spending.

IBM's RFM Aggregate Node documentation describes this transformation from transaction-level records into customer-level RFM metrics.

Step 4: Calculate Recency, Frequency, and Monetary Value

After preparing the customer data, calculate the three raw RFM measurements using consistent rules.

Recency (R)
R = Analysis Date − Latest Purchase Date
Example: December 1 − November 26 = 5 days
Frequency (F)
F = Count of Distinct Qualifying Orders
Example: 2 distinct completed orders = 2
Monetary Value (M)
M = Sum of Qualifying Order Values After Refunds
Example: $120 + $80 = $200

Step 5: Assign RFM Scores

Raw RFM measurements use different units. Recency may be expressed in days, frequency in order counts, and monetary value in dollars.

To make these measurements easier to interpret together, businesses can convert them into scores, commonly ranging from 1 to 5.

Under a conventional scoring approach:

  • Customers with more recent purchases receive higher recency scores.
  • Customers with more qualifying orders receive higher frequency scores.
  • Customers with greater spending receive higher monetary scores.

Scoring thresholds can be defined using business rules or customer-distribution methods such as percentiles.

For example, a business may assign the highest recency score to customers who purchased within the previous seven days.

There is no universal scoring threshold suitable for every business. The thresholds should reflect the purchasing cycle, transaction distribution, and analytical objectives.

Shopify's customer reports documentation provides an example of a five-point RFM scoring system.

Step 6: Create Customer Segments

Combine the three individual scores to describe customer behavior.

A customer with a recency score of 5, a frequency score of 5, and a monetary score of 5 receives the combined RFM code 555.

Another customer with a score of 155 has purchased less recently but has historically purchased frequently and spent substantial amounts.

These customers may require different business strategies.

The combined score is best interpreted as a three-part behavioral profile rather than a single mathematical measure of customer value.

RFM analysis workflow transforming transaction records into customer metrics, scores and segments.
From raw transaction data to actionable customer segments.

RFM Analysis Example: From Transactions to Customer Segments

Consider a small business that wants to understand its customers' purchasing behavior and identify opportunities for retention and repeat sales.

The business analyzes transaction data from September 1 to November 30, 2026, using December 1, 2026, as the reference date.

The following synthetic dataset illustrates how the process works. It does not represent actual customer records.

Original Customer Transaction Data

Each row represents a distinct completed order. For this example, all amounts are in US dollars, and no orders have been refunded.

Sample customer transaction dataset
Customer ID Order ID Order date Amount
C001ORD-0012026-11-26$120
C001ORD-0022026-11-10$80
C002ORD-0032026-11-29$350
C002ORD-0042026-11-15$300
C002ORD-0052026-10-25$250
C002ORD-0062026-10-12$200
C002ORD-0072026-09-20$150
C003ORD-0082026-09-25$300
C003ORD-0092026-09-20$250
C003ORD-0102026-09-10$350
C004ORD-0112026-11-28$75
C005ORD-0122026-09-15$45

Illustrative dataset: 12 completed orders from five customers. All monetary values are in USD.

Calculate RFM Metrics for Each Customer

The next step is to aggregate the transactions by customer.

For customer C001:

  • Recency: December 1 minus November 26 equals 5 days.
  • Frequency: Two distinct completed orders.
  • Monetary value: $120 plus $80 equals $200.

Applying the same calculations to every customer produces a summarized dataset with one record per customer.

Aggregated customer-level RFM metrics
Customer Last purchase Recency (days) Frequency Monetary value
C001Nov 26, 202652$200
C002Nov 29, 202625$1,250
C003Sep 25, 2026673$900
C004Nov 28, 202631$75
C005Sep 15, 2026771$45

Define the RFM Scoring Rules

To convert these raw values into comparable behavioral scores, the business establishes a five-point scoring system.

In this example, the highest recency score is assigned to customers who purchased within the previous seven days. Frequency and monetary scores increase as the number of purchases and total spending increase.

The following thresholds are illustrative business rules designed for this example. In a real implementation, businesses should adjust them according to their purchasing cycles, customer distribution, and analytical goals.

Illustrative RFM scoring thresholds
Score Recency Frequency Monetary value
5 0–7 days 5 or more orders $1,000 or more
4 8–14 days 4 orders $600–<$1,000
3 15–30 days 3 orders $300–<$600
2 31–60 days 2 orders $100–<$300
1 61 days or more 1 order Less than $100

These thresholds apply to customers with at least one qualifying purchase during the observation period.

Calculate and Interpret the Combined RFM Scores

Once the scoring thresholds are defined, each customer receives three individual scores.

For customer C001:

  • A recency of five days produces a score of 5.
  • A frequency of two purchases produces a score of 2.
  • A monetary value of $200 produces a score of 2.

Combining the scores in recency, frequency, and monetary order produces the RFM code 522.

The same scoring rules are applied to all remaining customers.

RFM scores and customer segments
Customer R F M RFM score Customer segment
C001522 522 Recently active repeat buyer
C002555 555 Champion
C003134 134 At-risk valuable customer
C004511 511 Recent single-purchase customer
C005111 111 Inactive low-spending customer

The results reveal meaningful differences between customers that would be difficult to identify from total sales alone.

Customer C002 is a frequent, recently active, high-spending buyer. Customer C003 has also generated substantial revenue but has not purchased recently, making this customer a candidate for further retention analysis.

Customer C004 has purchased recently but has only one recorded transaction. The business might encourage a second purchase through relevant follow-up communication.

This example demonstrates how RFM analysis transforms transaction records into customer groups that can support different business strategies.

Common RFM Customer Segments

Businesses often assign descriptive names to combinations of RFM scores to make the results easier to interpret and communicate.

These names and classifications are not standardized. Each organization should establish consistent rules that reflect its purchasing patterns and business objectives.

Common RFM customer segments and potential actions
Customer segment Typical behavior Potential business action
Champions Recent, frequent and high-spending customers. Offer relevant loyalty benefits and personalized services.
Loyal customers Customers who purchase repeatedly. Encourage continued engagement and repeat purchases.
Recently active customers Recent purchases with limited purchase frequency. Recommend relevant products and encourage another purchase.
At-risk valuable customers Previously valuable customers with declining recency. Investigate inactivity and test retention strategies.
Inactive customers Customers who have not purchased for an extended period. Evaluate whether re-engagement is commercially worthwhile.
Customer segmentation matrix showing customer groups based on purchase recency and frequency.
Customer segments based on recency and frequency, illustrating different engagement and retention opportunities.

Business Applications of RFM Analysis

Although RFM is commonly associated with e-commerce and marketing, its underlying methodology can support many businesses that maintain identifiable transaction histories.

Customer Retention

RFM analysis can help identify previously active customers who have not purchased recently.

Businesses can investigate these customers and test retention initiatives instead of applying the same approach to their entire customer base.

Personalized Marketing

Different customer groups may respond to different messages, offers, or product recommendations.

For example, frequent buyers may be suitable candidates for loyalty initiatives, while recent single-purchase customers may benefit from product education or relevant follow-up recommendations.

Sales and Account Prioritization

Sales teams can use RFM measurements as one input when reviewing customer accounts.

High historical spending combined with declining purchase activity may identify accounts that deserve further investigation.

Business-to-Business Customer Analysis

RFM principles can also be adapted to distributors, manufacturers, and service businesses with recurring transactions.

However, organizations should adjust their scoring rules to reflect longer purchasing cycles and contractual relationships.

An academic case study involving two machinery manufacturers demonstrates how RFM methodology can be adapted to product-oriented services.

Evaluating Customer Engagement

Tracking customer movement between segments over time can provide useful information about changes in purchasing behavior.

For example, a business can monitor whether previously inactive customers become active again following a retention initiative.

To evaluate whether an initiative actually caused the improvement, businesses should use appropriate comparisons or controlled experiments rather than relying solely on changes in RFM scores.

RFM Analysis vs. Customer Clustering

RFM analysis and customer clustering both help businesses identify customer groups, but they use different analytical approaches.

RFM scoring usually relies on defined behavioral measurements and scoring rules. Clustering uses algorithms to identify similarities within customer data and discover groups based on selected features.

These approaches are complementary rather than mutually exclusive.

RFM analysis compared with customer clustering
Feature RFM scoring Customer clustering
Method Behavioral scoring rules Algorithm-based grouping
Input data Recency, frequency and monetary value RFM metrics or additional customer features
Group formation Defined scoring and classification criteria Patterns and similarities in the data
Interpretability Usually straightforward Depends on the algorithm and features
Implementation Relatively simple scoring workflow Requires algorithm selection and validation
Best suited for Transparent purchasing-behavior segmentation Discovering more complex customer groups

Businesses can also combine these approaches by using raw RFM metrics as inputs to a clustering algorithm.

Rather than assigning every customer to a predefined group, clustering can identify patterns across recency, frequency, monetary value, and other relevant customer characteristics.

For algorithms such as K-means, appropriate feature scaling is important because monetary values may have a much larger numerical range than purchase frequency.

Our guide to data normalization in machine learning explains why preparing features on comparable scales can matter when building analytical models.

How to Perform RFM Analysis Without Coding

Implementing RFM analysis does not necessarily require Python, SQL, or custom software development.

For smaller datasets, spreadsheets can provide a practical starting point. Businesses can use grouping, aggregation, date calculations, and conditional formulas to calculate customer metrics and assign scores.

Visual analytics platforms can also help simplify parts of the process, depending on their supported data preparation and analytical capabilities.

Building a No-Code Customer Analysis Workflow

A typical workflow involves:

  1. Importing customer and transaction records.
  2. Preparing and validating the data.
  3. Calculating customer-level RFM metrics.
  4. Applying scoring rules or exploring customer groups.
  5. Reviewing the results and identifying appropriate business actions.

The specific implementation depends on the capabilities of the selected software.

Our guide on how to analyze data without coding provides additional information about building accessible analytical workflows.

How IIPA Supports Customer Data Analysis

IIPA provides a visual environment for connecting data sources, configuring analytical workflows, and reviewing results without writing code.

Its clustering capabilities allow businesses to explore groups of customers based on similar characteristics and behavior.

For organizations that have already calculated customer-level RFM metrics, these measurements can serve as useful inputs when exploring customer segmentation through compatible clustering workflows.

This approach can complement traditional RFM scoring by helping businesses investigate patterns beyond predefined customer categories.

Benefits and Limitations of RFM Analysis

RFM analysis provides a relatively straightforward method for understanding customer purchasing behavior, but it is important to recognize what the results can and cannot explain.

Benefits

  • Uses measurable information from existing transaction records.
  • Produces understandable customer behavior profiles.
  • Supports differentiated retention and marketing strategies.
  • Can be adapted to different industries and purchasing cycles.
  • Provides useful features for more advanced customer analytics.

Limitations

RFM analysis focuses on historical purchasing behavior. It does not directly explain why a customer purchased, why they became inactive, or whether they will make another purchase.

The methodology can also overlook important factors such as profitability, customer satisfaction, product preferences, and seasonal purchasing patterns.

Customers with no recorded purchases cannot be scored using conventional transaction-based RFM rules without defining additional handling.

RFM scores should not be confused with customer lifetime value. While historical purchasing patterns can contribute to lifetime value models, estimating future customer value requires additional assumptions and analytical methods.

The academic study RFM and CLV: Using Iso-Value Curves for Customer Base Analysis explores the relationship between these concepts.

Businesses should therefore treat RFM as a useful decision-support technique rather than a complete representation of customer behavior.

Frequently Asked Questions About RFM Analysis

What does RFM stand for?

RFM stands for recency, frequency, and monetary value. These measurements describe how recently a customer purchased, how frequently they purchased, and how much they spent.

How is an RFM score calculated?

Businesses calculate the three raw customer metrics and convert them into scores using defined thresholds or distribution-based methods. The individual scores can then be combined into a three-digit RFM code.

For example, individual scores of 5, 3, and 4 produce an RFM code of 534.

What is a good RFM score?

Under a conventional five-point scoring system, 555 indicates a customer with the highest score in all three dimensions. However, the most valuable customer profile depends on the organization's objectives, purchasing patterns, and scoring methodology.

Can RFM analysis be performed in Excel?

Yes. Excel and other spreadsheet applications can calculate RFM metrics using data aggregation, date calculations, order counts, and conditional formulas. Larger or more complex datasets may benefit from dedicated analytics tools.

Is RFM analysis a machine learning technique?

Traditional RFM scoring is not inherently a machine learning technique. It is a behavioral segmentation method. However, RFM measurements can be used as input features for machine learning algorithms such as customer clustering.

How often should businesses update RFM scores?

The appropriate update frequency depends on how often customers purchase and how the business uses its segments. Businesses with frequent transactions may update scores weekly or monthly, while organizations with longer purchasing cycles may require less frequent updates.

Conclusion: Turn Customer Data Into Meaningful Business Decisions

RFM analysis offers a practical way to understand customers through their purchasing behavior.

By measuring recency, frequency, and monetary value, businesses can identify active customers, recognize valuable relationships, and investigate opportunities for retention and engagement.

The effectiveness of RFM analysis depends on reliable transaction data, appropriate scoring rules, and thoughtful interpretation of the results.

When combined with additional customer information or analytical methods such as clustering, RFM can become part of a broader data-driven customer strategy.

Turn Your Customer Data Into Actionable Insights With IIPA

Explore how IIPA helps businesses connect data sources, build visual analytical workflows, and discover customer groups without writing code.

Explore IIPA or contact our team to learn more about our data analysis capabilities.

Sources and Further Reading