Statistical function

FREQUENCY function

Counts how many values fall into each band (bin) of a range, such as grade bands or order sizes, and returns the counts as a vertical list.

Available in All versions of Excel. In Microsoft 365 and Excel 2021+ the result spills; in older versions select the output cells first and confirm with Ctrl+Shift+Enter.

In every Excel versionWorks in Google Sheets

Syntax

FREQUENCY(data_array, bins_array)
ArgumentWhat it means
data_arrayRequiredThe values to count, e.g. test scores. Blank cells and text are ignored.
bins_arrayRequiredThe upper limits of each band, in ascending order. Each bin counts values greater than the previous limit and up to and including its own limit.

Returns: A vertical array with one more item than bins_array: the counts for each band plus a final count for values above the highest limit.

How FREQUENCY works

FREQUENCY builds a frequency table, the numbers behind a histogram. You give it the data and a list of band limits, and it returns how many values landed in each band. Typical uses are grade distributions (how many students scored 60–69?), order-size bands, salary ranges or delivery-time buckets.

Each limit in bins_array is the top of a band, and the top is included: with limits 59, 69, 79 and 89 the first count is for scores up to 59, the second for 60–69 (strictly above 59 and up to 69), and so on. FREQUENCY always returns one extra count at the end for everything above the last limit, so four limits produce five counts. Write the limits in ascending order.

In Microsoft 365 you type the formula in one cell and the counts spill downwards. In Excel 2019 and earlier you must select a range one cell taller than the bins, type the formula and press Ctrl+Shift+Enter. FREQUENCY ignores blanks and text, which also makes it a fast way to count unique numbers.

Examples

1Grade distribution

E2fx=FREQUENCY(A2:A8, C2:C5)
ABCDE
1ScoreBin (up to)
272591
385691
458792
591891
6672
778
895

Four limits give five counts, spilling from E2 to E6: 1 score up to 59 (58), 1 from 60 to 69 (67), 2 from 70 to 79 (72 and 78), 1 from 80 to 89 (85) and 2 above 89 (91 and 95). The counts always add up to the number of scores, here 7.

2Delivery-time buckets

F2fx=FREQUENCY(B2:B8, D2:D4)
ABCDEF
1OrderDaysUp to (days)
2SO-21122
3SO-22343
4SO-23361
5SO-2451
6SO-252
7SO-267
8SO-274

With limits 2, 4 and 6 the four counts are: 2 orders delivered within 2 days, 3 in 3–4 days, 1 in 5–6 days and 1 that took longer than 6 days. Place labels such as "≤2", "3–4", "5–6" and ">6" next to the spill to make it readable.

3Count unique customer IDs

D2fx=SUM(--(FREQUENCY(B2:B8, B2:B8)>0))
ABCD
1InvoiceCustomer ID
2INV-5001014
3INV-501102
4INV-502101
5INV-503103
6INV-504102
7INV-505104
8INV-506101

Result: 4

Using the data as its own bins, FREQUENCY puts each repeated ID's count in the bin of its first occurrence and 0 in the later ones. Counting the non-zero bins gives the number of different customers: 101, 102, 103 and 104, so 4. This classic trick works in every Excel version for numeric IDs.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB

Common errors and how to fix them

ErrorWhy it happensFix
#SPILL!Cells below the formula are not empty, so the counts cannot spill.Clear the cells under the formula (Microsoft 365 / Excel 2021+).
Only one number shownIn Excel 2019 or older the formula was entered in one cell or without Ctrl+Shift+Enter.Select as many cells as bins + 1, type the formula and press Ctrl+Shift+Enter.
Counts in the wrong bandsThe bin limits are not in ascending order or are stored as text.Sort the limits from smallest to largest and make sure they are numbers.

Tips

  • To count values in bands defined by lower limits ("60 and above"), use COUNTIFS instead, which gives you full control of < and <=.
  • Wrap FREQUENCY in a chart: select the spilled counts and insert a column chart for an instant histogram.
  • In Microsoft 365, =HSTACK(C2:C5, DROP(FREQUENCY(A2:A8, C2:C5), -1)) builds a two-column table of limits and counts (dropping the overflow count).

Questions

Why does FREQUENCY return one more value than I have bins?

The extra value counts everything above the highest bin. It is there so that no data point is lost; ignore it if you know all values are within range.

Are the bin limits inclusive?

Yes, each bin includes its upper limit. A score of exactly 69 goes in the 60–69 band when the limit is 69.

Can FREQUENCY count text values?

No, it only counts numbers. For text categories use COUNTIF, or combine UNIQUE with COUNTIF in Microsoft 365.

Google Sheets

FREQUENCY also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

FREQUENCY in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechČETNOSTI
DanishFREKVENS
DutchINTERVAL
FinnishTAAJUUS
FrenchFREQUENCE
GermanHÄUFIGKEIT
HungarianGYAKORISÁG
ItalianFREQUENZA
Norwegian (Bokmål)FREKVENS
PolishCZĘSTOŚĆ
Portuguese (Brazil)FREQÜÊNCIA
Portuguese (Portugal)FREQUÊNCIA
RussianЧАСТОТА
SpanishFRECUENCIA
SwedishFREKVENS
TurkishSIKLIK