Make a frequency table in Excel with COUNTIFS
A frequency table counts how many values fall in each band. Build one with COUNTIFS, choose the bands, show percentages, and check it adds up to the total.
A frequency table counts how many values fall in each band. In Excel, you build one with COUNTIFS. You write one formula per band, with a lower limit and an upper limit.
Say you lead a support team. Your manager asks how many calls are short and how many are long. The phone system gives you the length of each call in minutes. This is the export, in A1 to C13:
| Row | A | B | C |
|---|---|---|---|
| 1 | Call | Minutes | Reason |
| 2 | 1 | 3.5 | Billing |
| 3 | 2 | 7 | Delivery |
| 4 | 3 | 12 | Billing |
| 5 | 4 | 5 | Returns |
| 6 | 5 | 18.2 | Delivery |
| 7 | 6 | 9.5 | Billing |
| 8 | 7 | 4.5 | Delivery |
| 9 | 8 | 10 | Billing |
| 10 | 9 | 2 | Returns |
| 11 | 10 | 15 | Delivery |
| 12 | 11 | 6 | Billing |
| 13 | 12 | 11 | Returns |
Choose the bands
Look at the smallest and largest value first. =MIN(B2:B13) gives
2 and =MAX(B2:B13) gives 18.2. So bands of 5 minutes, from 0,
cover everything in 4 bands.
Type the limits in their own cells, not inside the formulas. Put the lower limits in E2:E5 and the upper limits in F2:F4. The last band has no upper limit. It holds every call of 15 minutes or more.
Each band starts at its lower limit and stops just before its upper limit. So the first band is 0 to under 5. A call of exactly 5 minutes goes in the second band. Decide this rule once and use it for every band.
Count each band with COUNTIFS
In G2, type:
=COUNTIFS($B$2:$B$13,">="&E2,$B$2:$B$13,"<"&F2)
It gives 3. Fill it down to G4, which gives 4 and 3. For the last band, type
=COUNTIF($B$2:$B$13,">="&E5) in G5. It gives 2.
The formula has 2 pairs of range and test. The first pair keeps calls of E2 minutes or more. The second keeps calls of less than F2 minutes. A call is counted only if it passes both.
The test is text in quote marks, joined to the cell with &. So
">="&E2 becomes ">=0". The dollar signs keep the
range on B2:B13 when you fill down. The
COUNTIFS practice has more on the
tests.
Add a share for each band
In G6, total the counts with =SUM(G2:G5). It gives 12. In H2,
type =G2/$G$6 and fill it down to H5. Press Ctrl+Shift+% to show
the answers as percentages.
| Row | E | F | G | H |
|---|---|---|---|---|
| 1 | From | To | Calls | Share |
| 2 | 0 | 5 | 3 | 25% |
| 3 | 5 | 10 | 4 | 33% |
| 4 | 10 | 15 | 3 | 25% |
| 5 | 15 | 2 | 17% | |
| 6 | 12 | 100% |
H3 holds 0.3333 and more 3s, which shows as 33%. H5 holds about 0.1667, which shows as 17%. The 4 shares add up to 100%. The percentages article explains why the $ on G6 matters.
Check that it adds up
This is the most useful formula on the sheet.
=SUM(G2:G5)=COUNT(B2:B13) gives TRUE. Every call is in exactly
one band. If it gives FALSE, a call is counted twice or not at all.
Here are the 2 ways that happens.
Bands that share an edge
Use "<=" instead of "<" for the upper limit, and the bands overlap. The call of 5 minutes is now in the first band and the second. So are the calls of 10 and 15.
The counts become 4, 5, 4 and 2. That is 15 calls from a list of 12. No error shows. Only the check finds it.
Bands with a gap
Labels like 0–4, 5–9 and 10–14 look fine for whole numbers. Write them as tests like ">=5" and "<=9", and a call of 4.5 or 9.5 minutes fits no band.
The counts become 2, 3, 3 and 2. That is 10 calls. The 2 calls with half minutes are lost.
The rule "from the lower limit, up to but not including the upper limit" avoids both. Each band starts where the one before it stops.
Count text instead of numbers
The same table works for words. Here, each label is its own band. To count calls by reason, list each reason once, then count it.
In J2, type =UNIQUE(C2:C13). It fills J2:J4 with Billing,
Delivery and Returns.
In K2, type =COUNTIF($C$2:$C$13,J2) and fill it down. It gives
5, 4 and 3. The total is 12 again.
UNIQUE needs Excel 2021 or later, Microsoft 365 or Excel for the web. In older versions, type the labels yourself. The COUNTIF part works in every version.
What about the FREQUENCY function?
Excel has a FREQUENCY function too. It takes the values and a list of upper limits:
=FREQUENCY(B2:B13,F2:F4). It returns one count per limit, and
one more for everything above the last limit.
The difference is the edges. FREQUENCY puts a value that equals a limit into the band below it. So here it gives 4, 4, 3 and 1, not 3, 4, 3 and 2. The call of 5 minutes is in the first band.
In Microsoft 365, Excel 2021 and later, the 4 counts fill the cells below by themselves. In older versions you select 4 cells first and press Ctrl+Shift+Enter.
Use COUNTIFS unless you already know FREQUENCY well. Each COUNTIFS shows its own rule. The next person who opens your file can read where the edges are.
The 2 lessons below build a frequency table and practise COUNTIFS. Each lesson is a real sheet you type into, and each answer is checked when you press Enter.