Lesson 77 of 92 · Free Excel Course
Excel · Excel function reference
Excel FREQUENCY Function: Syntax, Examples and Common Errors
How the Excel FREQUENCY function counts numbers in bins: the extra overflow cell, inclusive bin tops, grade bands, distinct counts and fixes for common errors.
The FREQUENCY function counts how many numbers fall into each of a set of ranges, called bins. You give it a list of values and a list of bin tops, and it returns a column of counts: how many values are up to the first bin, how many are between the first and second, and so on, plus one extra count for everything above the last bin. It's the quick way to build a frequency table for test scores, ages or order sizes. Microsoft lists it for Excel for Microsoft 365 (Windows and Mac), Excel for the web, Excel 2024, 2021, 2019 and 2016.
Syntax
=FREQUENCY(data_array, bins_array)
| Argument | Required? | What it does |
|---|---|---|
| data_array | Required | The numbers to count, as a range or array. Blank cells and text are ignored. If it holds no numbers, every count is 0. |
| bins_array | Required | The top of each band, smallest first. Each bin counts values greater than the bin before it and up to and including itself. If it holds no numbers, FREQUENCY returns the count of all values in data_array. |
Two rules shape every FREQUENCY formula:
- You get one more result than you have bins. The last cell is the overflow bin: values above your highest bin.
- How you enter it depends on your version. In Microsoft 365, Excel 2021 or later and Excel for the web, type it in the top cell and press Enter; the counts spill down. In Excel 2019 and 2016, select the whole output range first (bins plus one cell), type the formula and press Ctrl+Shift+Enter. Excel wraps it in curly brackets to show it's an array formula.
Examples
1. Test scores in three bins (Microsoft's example). Nine scores in A2:A10 and bin tops 70, 79 and 89 in B2:B4. Three bins give four counts.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Scores | Bins | Count | What it counts | |
| 2 | 79 | 70 | 1 | 70 or less | |
| 3 | 85 | 79 | 2 | 71 to 79 | |
| 4 | 78 | 89 | 4 | 80 to 89 | |
| 5 | 85 | 2 | Above 89 | ||
| 6 | 50 | ||||
| 7 | 81 | ||||
| 8 | 95 | ||||
| 9 | 88 | ||||
| 10 | 97 |
Check it by hand: 50 is the only score of 70 or less; 79 and 78 are in the 71 to 79 band; 85, 85, 81 and 88 are in 80 to 89; 95 and 97 spill into the overflow. Microsoft's page labels that last row "greater than or equal to 90", but strictly it counts anything above 89, so a score of 89.5 would land there too.
2. Grade bands with edge values. For an F-to-A grade table, use bin tops 59, 69, 79 and 89. You don't need a bin for A: the overflow cell catches everything above 89.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Test score | Bin (top) | Grade | Students |
| 2 | 92 | 59 | F | 1 |
| 3 | 58 | 69 | D | 2 |
| 4 | 74 | 79 | C | 2 |
| 5 | 88 | 89 | B | 3 |
| 6 | 67 | A | 2 | |
| 7 | 81 | |||
| 8 | 95 | |||
| 9 | 73 | |||
| 10 | 60 | |||
| 11 | 89 |
The same D band with COUNTIFS takes two conditions: =COUNTIFS(A2:A11,">"&B2,A2:A11,"<="&B3) also returns 2. COUNTIFS needs a separate formula for each band and a special one for the first and last bands; FREQUENCY does all five at once. Reach for COUNTIFS when you need another condition, such as counting only one class.
3. Count distinct numbers. If FREQUENCY uses the same range as both data and bins, each number gets its count at its first appearance and 0 at every repeat. Counting the results above 0 gives the number of different values. Eight orders here came from four customers.
| A | B | C | |
|---|---|---|---|
| 1 | Customer ID | Distinct customers | |
| 2 | 1041 | 4 | |
| 3 | 1052 | ||
| 4 | 1041 | ||
| 5 | 1077 | ||
| 6 | 1052 | ||
| 7 | 1041 | ||
| 8 | 1090 | ||
| 9 | 1077 |
SUMPRODUCT works without Ctrl+Shift+Enter in every version. In Microsoft 365 and Excel 2021 or later, =SUM(--(FREQUENCY(A2:A9,A2:A9)>0)) gives the same 4 with a plain Enter. It counts numbers only; for text, use =COUNTA(UNIQUE(A2:A9)) in Microsoft 365.
FREQUENCY or the Histogram tool? The Analysis ToolPak's Histogram, covered in Statistics in Excel, produces the same counts plus an optional chart, but as fixed values: change a score and you must run it again. FREQUENCY is a live formula, so the table updates the moment the data changes. Chart its results with a plain column chart.
Common errors
| What you see | Why | Fix |
|---|---|---|
| Only some counts, no overflow cell | In older Excel you selected exactly as many cells as bins before pressing Ctrl+Shift+Enter. | Select the range again with one extra cell and re-enter the formula. |
| #N/A in the bottom cells | In older Excel you selected more cells than bins plus one. | Select a range exactly one cell taller than the bins. |
| "You can't change part of an array" | You tried to edit or delete one cell of an old-style array formula. | Select the whole output range, then edit or press Delete. |
| #SPILL! | In Microsoft 365 or Excel 2021 and later, cells below the formula aren't empty, or the formula is inside an Excel table. | Clear the cells below, or move the formula outside the table. |
| Counts add up to less than your list | FREQUENCY skips blank cells and text, including numbers stored as text. | Convert text numbers to real numbers (they usually sit left-aligned). |
| A value lands one band too high | Your data has decimals just above a bin top (89.5 with a bin of 89), so it counts in the next band. | Pick bin tops that match your real cut-offs, such as 89.99 if 89.5 should still be a B. Keep the bins in a column, smallest first, so the counts read in order. |
Related functions
- Statistics in Excel: averages, spread, the Analysis ToolPak and histograms.
- UNIQUE function: lists and counts distinct values, including text.
- RANK function and LARGE function: place a score within the list instead of counting bands.
- COUNTIF, SUMIF and AVERAGEIF: count with conditions, one band at a time.
Try it yourself
Download the practice workbook. It has Microsoft's score example, the grade-band table with a COUNTIFS check, and the customer IDs for a distinct count (SUMPRODUCT and SUM versions), each with a yellow cell to fill in. The Answers sheet has the working formulas.
Frequently asked questions
Why does FREQUENCY return one more value than I have bins?
The last result is the overflow bin. It counts every value greater than your highest bin, so nothing is left out. With bins 70, 79 and 89 you get four counts: 70 or less, 71 to 79, 80 to 89, and above 89.
Do I still need Ctrl+Shift+Enter for FREQUENCY?
Not in Microsoft 365, Excel 2021 or later, or Excel for the web: type the formula in the top cell and press Enter, and the counts spill down. In Excel 2019 and older you must select the whole output range first (one cell more than the bins), type the formula and press Ctrl+Shift+Enter. Excel then adds curly brackets around it.
Is a value equal to the bin counted in that bin?
Yes. Each bin is an upper limit that includes itself. With a bin of 89, a score of 89 lands in that bin and 89.5 lands in the next one.
Should I use FREQUENCY or COUNTIFS?
FREQUENCY counts every band in one formula and adds the overflow band for you. COUNTIFS needs one formula per band, but it can add extra conditions (such as a region or a date) and works on text. See COUNTIF, SUMIF and AVERAGEIF.
Can FREQUENCY count text values?
No. Microsoft says FREQUENCY ignores blank cells and text, and numbers stored as text are skipped too. To count words or names, use COUNTIF, or list and count them with the UNIQUE function.