FREQUENCY function
FREQUENCY builds a frequency table, returning a vertical array that counts how many values fall at or below each bin limit and above the previous one. The result has one more item than the bins.
Example
Read it as a sentence: count how many numbers in A1:A8 fall at or below 3, then between 3 and 5, then above 5, starting with 1 for the first group.
Syntax
FREQUENCY(data_array, bins_array)
-
data_array(required) - Values to count.
-
bins_array(required) - Upper limits of the intervals.
Returns: A vertical array of counts per interval, with one extra cell for values above the last bin.
One FREQUENCY formula can fill more than one cell. When the result has several values, they spill into the cells below or to the right of the formula.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=INDEX(FREQUENCY({1,2,3,4,5,6},{2,4}),2) | 2 | INDEX into result |
=FREQUENCY(5,4) | 0 | Scalar data and bin |
=FREQUENCY(Data!A1:A8,{3,5}) | 1 | Range with bins (spills n+1) |
=FREQUENCY(Data!A1:A8,{5,3}) | 5 | Unsorted bins |
=FREQUENCY(Data!A1:A8,Data!D1:D2) | 0 | Empty bins range |
=FREQUENCY(Data!B1:B8,{25}) | 1 | Mixed data (text ignored) |
=FREQUENCY(Data!A1:A8,Data!B1:B3) | 8 | Bins with text |
=FREQUENCY(Data!C1:C5,{2}) | #N/A | #N/A in data |
The Data sheet these formulas read
A cell that starts with = holds that formula.
Watch out for
- Output has one more row than bins_array.
- Older Excel needs Ctrl+Shift+Enter to fill the whole output range.
- Blanks and text in data are ignored.
Where it works
- Excel
- FREQUENCY is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .