ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Projects
  3. RFM Analysis in Excel: Segment Customers by Value

RFM Analysis in Excel: Segment Customers by Value

By ExcelReady Team·Updated November 3, 2026·7 min read

The short answer

RFM analysis scores each customer on Recency (days since the last order), Frequency (number of orders) and Monetary value (total spend). In Excel, get recency with an analysis date minus MAXIFS, frequency with COUNTIFS and spend with SUMIFS. Then turn each number into a score from 1 to 3 with IFS and join the scores into a segment code.

Key takeaways

  • Recency = analysis date minus the last order date, found with MAXIFS.
  • Frequency is COUNTIFS on the customer column, and Monetary value is SUMIFS on the amount column.
  • Use a fixed analysis date in a cell, not TODAY(), so the scores don't change every day.
  • For recency, fewer days is better, so the score runs the other way from frequency and spend.
  • Join the three scores with & to get codes like 333 or 133, then name the groups you care about.
On this page+
  1. What RFM analysis measures
  2. Step 1: set up the order list and an analysis date
  3. Step 2: calculate recency with MAXIFS
  4. Step 3: calculate frequency and monetary value
  5. Step 4: turn each measure into a score
  6. Step 5: build the RFM code and segments
  7. Common RFM mistakes in Excel
  8. Practise it

RFM analysis in Excel scores every customer on three things: Recency (how many days since the last order), Frequency (how many orders) and Monetary value (how much they spent in total). You build it with three formulas, MAXIFS, COUNTIFS and SUMIFS, then turn each number into a score and group customers with similar scores. This guide is for analysts, marketers and job seekers who want a clear, repeatable way to segment a customer list using only an order export.

What RFM analysis measures#

RFM looks at buying behaviour, not at who the customer is. The three measures answer three simple questions:

LetterMeasureQuestionBetter when
RRecencyHow long since the last order?Lower (fewer days)
FFrequencyHow many orders?Higher
MMonetary valueHow much in total?Higher

A customer who bought last week, buys often and spends a lot scores high on all three. A customer who bought once, months ago, scores low. The scores don't predict anything on their own. They give you groups you can compare, report on and treat differently. The data below is example data.

Step 1: set up the order list and an analysis date#

Start from one row per order. Put the orders on a sheet called Orders, with the order date in column A, the customer in column B and the amount in column C. A short example looks like this:

ABC
1Order dateCustomerAmount
214 Jul 2026Ana120
32 Aug 2026Ben340
421 Sep 2026Ana95
530 Sep 2026Cai60

On a second sheet, list each customer once in column A. In Microsoft 365 or Excel 2021, =UNIQUE(Orders!B2:B500) does this for you. Then type an analysis date in H1, for example 31 Oct 2026, the day after the data ends.

Use a fixed date, not TODAY(). With TODAY(), every recency value changes overnight, so a segment you report on Monday is different by Friday.

Step 2: calculate recency with MAXIFS#

Recency is the analysis date minus the customer's latest order date. MAXIFS finds the latest date, because a later date is a bigger number in Excel. In B2:

Excel formula
=$H$1-MAXIFS(Orders!$A$2:$A$500,Orders!$B$2:$B$500,A2)

MAXIFS works like MAX, but only over the rows that match a condition. The plain MAX function would return the latest date in the whole list. MAXIFS needs Excel 2019 or later; the guide to MAXIFS and MINIFS covers it in detail. Format the result as a number, not a date, or Excel may show it as a date in 1900.

Step 3: calculate frequency and monetary value#

Frequency is a count of orders, and monetary value is a sum of amounts, both for one customer. In C2 and D2:

Excel formula
C2: =COUNTIFS(Orders!$B$2:$B$500,A2)
D2: =SUMIFS(Orders!$C$2:$C$500,Orders!$B$2:$B$500,A2)

Fill all three formulas down (Windows: Ctrl+D; Mac: ⌘D). The $ signs keep the order ranges fixed while A2 moves down the list. The COUNTIFS function guide and the SUMIFS function guide explain the arguments, and the article on COUNTIFS and SUMIFS with several conditions shows how to add a date range, for example only orders from the last 12 months.

With a full order list, the summary for six example customers looks like this:

ABCD
1CustomerRecency (days)FrequencyMonetary
2Ana681,640
3Ben293520
4Cai7751,100
5Dee16471,380
6Eli11185
7Fay242160

Step 4: turn each measure into a score#

A score puts every customer on the same 1-to-3 scale, so the three measures can be read together. Pick cut-off values that make sense for your business and keep them in cells. Here, with IFS:

Excel formula
E2: =IFS(B2<=30,3,B2<=90,2,TRUE,1)
F2: =IFS(C2>=6,3,C2>=3,2,TRUE,1)
G2: =IFS(D2>=1000,3,D2>=400,2,TRUE,1)

Notice that recency runs the other way: fewer days gives a higher score. IFS checks the tests in order and stops at the first TRUE one, and the final TRUE,1 catches everything else.

For larger lists, many analysts use 1 to 5 and set the cut-offs with percentiles, so each score holds about the same number of customers. For example, =PERCENTILE.INC(D2:D500,0.8) gives the spend that only the top 20% reach. The guide to percentiles and quartiles shows how.

Step 5: build the RFM code and segments#

Join the three scores into one code with &. In H2:

Excel formula
=E2&F2&G2
CustomerRFMCodeWhat the pattern says
Ana333333Recent, frequent, high spend
Ben322322Recent, moderate
Cai223223Fairly recent, high spend
Dee133133Used to buy often, not recently
Eli311311New: one recent order
Fay111111One small order, long ago

The codes are descriptions, not verdicts. Name the groups that matter to you, such as "Top customers" for 333 or "Lapsed regulars" for codes that start with 1 and have high F and M. To count each segment, use =COUNTIF(H2:H7,"333"), or =COUNTIF(H2:H7,"1*") for every code that starts with 1.

Common RFM mistakes in Excel#

A few slips make RFM scores misleading. Check these:

  1. Returns and refunds counted as orders. Negative amounts reduce spend but still add to frequency. Filter them out with an extra COUNTIFS condition such as Orders!$C$2:$C$500,">0".
  2. Customer names that don't match. "Ana Lopez" and "Ana Lopez " (with a space) are two customers. Use a customer ID if you have one.
  3. Recency shown as a date. The result of a date minus a date may pick up a date format. Change it to Number.
  4. Cut-offs typed inside formulas. Put them in cells so you can change them and see the effect on every score.
  5. Mixing time periods. Use the same date window for all three measures, for example the last 12 months.

Once the scores are in place, a PivotTable or a short summary table turns them into a report. The sales report guide shows how to lay one out, and the simple Excel CRM is a good home for the customer list.

Practise it#

RFM is three conditional formulas you will use in any customer or sales job. Practise COUNTIFS and SUMIFS in a live spreadsheet, then practise AVERAGEIF and MAXIFS to find latest dates by customer. ExcelReady checks each formula as you type. Start with Ben's recency in the exercise on this page.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Find Ben's recency: the number of days from his last order to the analysis date in F1. Click F3, subtract MAXIFS from F1, and press Enter.

fx
ABCDEFG
1
Order date
Customer
Amount
Analysis date
46326
2
46217
Ana
120
Customer
Ben
3
46236
Ben
340
Recency (days)
4
46286
Ana
95
5
46295
Cai
60
6
46304
Ana
180
7
46313
Ben
75
8
46322
Cai
210
9
10
11

Tip: MAXIFS(A2:A8,B2:B8,F2) finds Ben's latest order date. Subtract it from the analysis date in F1.

Practise this in a lesson

LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.LessonAVERAGEIF, MAXIFS and MINIFSFind the average, highest and lowest values that meet one or more conditions.Function guideSUMIFSTotal values that meet several conditions with SUMIFS. Examples by region, month and number range, common errors, and live practice.Function guideCOUNTIFSCount rows that meet several conditions with COUNTIFS. Examples for text, number ranges and between-values, plus a live exercise.Function guideMAXFind the largest value in Excel with MAX: top sales, latest dates and the rep behind them. Common mistakes, plus a live exercise to try.

Frequently asked questions

What is RFM analysis?

+

RFM analysis groups customers by three numbers: how recently they bought (Recency), how often they bought (Frequency) and how much they spent (Monetary value). Each number is turned into a score, and the scores together describe the customer.

How do I calculate recency in Excel?

+

Put a fixed analysis date in a cell, then subtract each customer's last order date: =$H$1-MAXIFS(Orders!$A$2:$A$500,Orders!$B$2:$B$500,A2). The result is the number of days since the last order.

Should I use TODAY() for RFM recency?

+

It is safer to use a fixed date, such as the last day of the data. With TODAY(), every recency value and score changes each day, so last week's segments can't be compared with this week's.

How do I score RFM in Excel?

+

Use IFS with cut-off values, for example =IFS(B2<=30,3,B2<=90,2,TRUE,1) for recency. For larger lists, set the cut-offs with percentiles so each score holds a similar share of customers.

Sources

  • MAXIFS function - Microsoft Support
  • COUNTIFS function - Microsoft Support
  • SUMIFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What RFM analysis measures
  2. Step 1: set up the order list and an analysis date
  3. Step 2: calculate recency with MAXIFS
  4. Step 3: calculate frequency and monetary value
  5. Step 4: turn each measure into a score
  6. Step 5: build the RFM code and segments
  7. Common RFM mistakes in Excel
  8. Practise it

Keep reading

Conditional math· 7 min read

MAXIFS and MINIFS: Highest and Lowest With Conditions

MAXIFS returns the highest number among the rows that meet one or more conditions, and MINIFS returns the lowest. Both put the numbers first, then range/criteria pairs: =MAXIFS(D2:D9,B2:B9,"Marketing") finds the top Marketing salary. They need Excel 2019 or newer. If nothing matches, they return 0, not an error.

Math· 7 min read

PERCENTILE and QUARTILE in Excel, Explained Simply

A percentile is the value below which a given share of your data falls. In Excel, =PERCENTILE.INC(B2:B11,0.9) returns the 90th percentile, and =QUARTILE.INC(B2:B11,1) returns the first quartile (the 25th percentile). Write the percentile as a decimal between 0 and 1, or as a percentage such as 90%. The 50th percentile is the median.

Conditional math· 7 min read

COUNTIFS and SUMIFS: Multiple Conditions in Excel

COUNTIFS counts rows that meet several conditions, and SUMIFS adds numbers from those rows. Each condition is a pair: a range, then its criteria. A row counts only if it matches every pair. SUMIFS puts the sum range first: =SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop") totals North laptop revenue.

More on projects

  • Build a Risk Register in Excel With Risk Scores
  • Build a Simple Sales Dashboard in Excel
  • Build a Simple Sales Forecast in Excel
  • How to Make a Sales Leaderboard in Excel That Updates
  • Build a Sales Pipeline Tracker in Excel
  • Build a Simple Sales Report in Excel
All projects articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free