To find relative frequency in Excel, count how often each value appears, then divide each count by the total. With your categories listed in D2:D6, enter =COUNTIF($A$2:$A$21,D2) in E2 to count each one, put the total in E7 with =SUM(E2:E6), and enter =E2/$E$7 in F2. Copy the formulas down, then select the results and choose Home > Percent Style to show them as percentages. Once you have relative frequencies, you can use them as probabilities to calculate expected value in Excel.
Relative frequency is the share of all observations that fall into one group. It is a proportion between 0 and 1, and all the relative frequencies in a table add up to 1 (100%). This guide shows the formula method for text categories, the FREQUENCY function for numbers grouped into ranges, a PivotTable method that needs no formulas, cumulative relative frequency, and how to chart the results.
Which method do you need?
| Your data | Best method | What you get |
|---|---|---|
| Text categories (survey answers, product names) | COUNTIF and divide by the total | A live table that updates when data changes |
| Numbers you want grouped into ranges (scores, ages) | FREQUENCY or COUNTIFS | Counts and relative frequency per range |
| A large table you don’t want to write formulas for | PivotTable with % of Grand Total | Counts and percentages in a few clicks |
| You want a running share | Running SUM or % Running Total In | Cumulative relative frequency |
Method 1: Relative frequency for categories with COUNTIF
This example uses 20 survey answers about favorite fruit, typed in A2:A21. The answers are Apple (7 times), Banana (5), Cherry (4), Grape (3) and Mango (1).
- List each category once. Type the unique values in D2:D6. In Microsoft 365 or Excel 2021 and later,
=UNIQUE(A2:A21)in D2 lists them for you. In older versions, copy column A and use Data > Remove Duplicates on the copy. Your data does not need to be sorted. - Count each category. In E2, enter
=COUNTIF($A$2:$A$21,D2)and copy it down to E6. The COUNTIF function counts the cells in a range that match one criterion. - Get the total. In E7, enter
=SUM(E2:E6). You can also count the original answers with=COUNTA(A2:A21). Use COUNTA, not COUNT, for text: COUNT only counts numbers, so it returns 0 for a list of fruit names. Both give 20 here. - Divide each count by the total. In F2, enter
=E2/$E$7and copy it down. The dollar signs lock the reference to the total so it doesn’t shift as you copy. - Format as percentages. Select F2:F6 and choose Home > Percent Style, or press Ctrl + Shift + %.

Your finished table looks like this:
| Fruit (D) | Frequency (E) | Relative frequency (F) | As a percent |
|---|---|---|---|
| Apple | 7 | 0.35 | 35% |
| Banana | 5 | 0.25 | 25% |
| Cherry | 4 | 0.20 | 20% |
| Grape | 3 | 0.15 | 15% |
| Mango | 1 | 0.05 | 5% |
| Total | 20 | 1.00 | 100% |
Add =SUM(F2:F6) in F7 as a check. It should show 1, or 100% once formatted.
Formatting: don’t multiply by 100
Keep the formula as a plain division and let the format do the rest. Microsoft’s guide to formatting numbers as percentages explains that Excel multiplies existing numbers by 100 when you apply Percentage format, so 0.35 shows as 35%. If you write =E2/$E$7*100 and then apply Percentage, you get 3500%.
To control decimal places, open the Number dialog box launcher on the Home tab (on a Mac, use the Number Format box > More Number Formats), choose the Percentage category and set Decimal places.
Method 2: Grouped numbers with FREQUENCY
For numbers such as test scores, you usually group values into ranges (bins) first. If you’re not sure how to choose ranges, see how to create bins in Excel.
This example has 15 test scores in A2:A16: 52, 58, 61, 65, 67, 70, 72, 74, 78, 81, 83, 85, 88, 92 and 97.
- Enter the upper limit of each bin in C2:C5:
59,69,79and89. Each bin counts values above the previous limit, up to and including its own. - Add labels in B2:B6 so the table is readable: 59 or below, 60 to 69, 70 to 79, 80 to 89, and Over 89.
- Enter FREQUENCY. In D2, enter
=FREQUENCY(A2:A16,C2:C5).- In Microsoft 365 or Excel 2021 and later, press Enter. The results spill into D2:D6 automatically.
- In older versions, select D2:D6 first, type the formula, and press Ctrl + Shift + Enter.
- Divide by the total. In E2, enter
=D2/COUNT($A$2:$A$16)and copy it down to E6. COUNT is right here because the scores are numbers. In Microsoft 365 or Excel 2021 and later you can do it in one step with=FREQUENCY(A2:A16,C2:C5)/COUNT(A2:A16). - Apply Percent Style and set two decimal places.
Notice that four bin limits produce five results. Microsoft’s FREQUENCY function page says the returned array has one more element than bins_array; the extra one counts values above the highest bin. If you select only four cells in older Excel, you lose the two scores above 89. FREQUENCY also ignores blank cells and text.
| Range (B) | Bin (C) | Frequency (D) | Relative frequency (E) |
|---|---|---|---|
| 59 or below | 59 | 2 | 13.33% |
| 60 to 69 | 69 | 3 | 20.00% |
| 70 to 79 | 79 | 4 | 26.67% |
| 80 to 89 | 89 | 4 | 26.67% |
| Over 89 | (extra result) | 2 | 13.33% |
| Total | 15 | 100.00% |
Alternative: COUNTIFS for each range
If you’d rather have one ordinary formula per row, COUNTIFS counts values between a lower and upper limit. For the 60 to 69 range: =COUNTIFS($A$2:$A$16,">59",$A$2:$A$16,"<=69"). Watch the boundaries. If one row uses "<=49" and the next starts at ">=50", a value like 49.5 falls through the gap. Using ">59" instead of ">=60" avoids that for decimal data.
Method 3: PivotTable with % of Grand Total
A PivotTable counts and calculates percentages without any formulas, which helps with long lists.
- Click any cell in your data (it needs a header, such as Fruit) and select Insert > PivotTable > OK.
- In the field list, drag Fruit to Rows, then drag Fruit again to Values. Excel shows Count of Fruit.
- Drag the same field into Values a second time, so you have two count columns.
- Right-click a number in the second count column and select Show Values As > % of Grand Total.

You now see the count and relative frequency side by side. Microsoft’s guide to showing different calculations in PivotTable value fields lists this option, plus % of Column Total and % Running Total In. On a Mac, select More Options if Show Values As isn’t listed.
For numeric data, you can right-click a value in the Rows area and choose Group to set ranges, such as a start, end and step of 10. If Excel refuses to group, the column may contain blanks or text. A PivotTable doesn’t update by itself, so right-click it and choose Refresh after you change the data.
Cumulative relative frequency
Cumulative relative frequency shows the running share up to each row, so the last row is always 100%. Using the fruit table, enter =SUM($F$2:F2) in G2 and copy it down. Only the first cell reference is locked, so the range grows by one row each time.
| Fruit | Relative | Cumulative |
|---|---|---|
| Apple | 35% | 35% |
| Banana | 25% | 60% |
| Cherry | 20% | 80% |
| Grape | 15% | 95% |
| Mango | 5% | 100% |
For the test scores, the cumulative values are 13.33%, 33.33%, 60.00%, 86.67% and 100.00%. That tells you, for example, that 60% of students scored 79 or below. In a PivotTable, choose Show Values As > % Running Total In instead.
Chart the relative frequency
Excel’s built-in histogram, at Insert > Insert Statistic Chart > Histogram, plots counts, not relative frequency. Microsoft’s guide to creating a histogram shows how to set the bin width, number of bins and overflow bin by right-clicking the horizontal axis and choosing Format Axis. It’s useful for a quick look at the shape of the data.
To chart relative frequency itself:
- Select the label column and the relative frequency column (for example B1:B6 and E1:E6; hold Ctrl to select both).
- Select Insert > Insert Column or Bar Chart > Clustered Column.
- For a histogram look, right-click a bar, choose Format Data Series, and set Gap Width to 0%.
The Analysis ToolPak add-in also has a Histogram tool that can output a frequency table with a cumulative percentage column. Load it on Windows with File > Options > Add-Ins, choose Excel Add-ins in the Manage box, select Go and tick Analysis ToolPak. On a Mac, use Tools > Excel Add-ins. Then open Data > Data Analysis, as Microsoft’s guide to using the Analysis ToolPak describes. In the Histogram dialog, select Cumulative Percentage to add the running share.
Common problems
- Percentages show as 3500%. You multiplied by 100 and applied Percentage format. Remove the
*100. - Every row divides by the wrong cell. The total reference wasn’t locked. Use
$E$7, notE7. - The total is 0. You used COUNT on text. Switch to COUNTA or SUM the counts.
- One category is split in two. A stray space makes “Apple ” different from “Apple”. Microsoft’s COUNTIF page suggests TRIM or CLEAN to remove extra spaces and nonprinting characters. COUNTIF isn’t case sensitive, so “apple” and “Apple” are counted together.
- #SPILL! from FREQUENCY. Something is in the cells below the formula. Clear them so all results (bins plus one) can spill.
- The total is 99.9% or 100.1%. That’s rounding in the displayed values. The underlying numbers still add to 1.
For a simple measure of spread, see how to calculate mean absolute deviation in Excel.
Questions
Can relative frequency be more than 1?
No. A group can’t contain more than all the observations, so each relative frequency is between 0 and 1, and together they add up to exactly 1.
What’s the difference between frequency and relative frequency?
Frequency is the count, such as 7 people choosing Apple. Relative frequency is that count divided by the total, such as 7 out of 20, or 0.35. It lets you compare groups of different sizes.
Do I need to sort my data first?
No. COUNTIF, FREQUENCY and PivotTables all work on unsorted data. Sorting only makes the table easier to read.
Matt Williams is the writer and editor behind TechInfoHome. He holds a degree in computer science and has more than 10 years of experience working in IT. For the past 5 years he has written online tutorials for Windows, Microsoft Office, Google apps and iPhone, with a focus on clear steps that get readers to a working fix quickly.