← All how-to recipes

How to create a frequency distribution (count values in bins)

✓ Verified in LibreOffice 25.8.7.3

Count how many values fall into each range — histogram bins, score bands, age groups.

The formula

AppFormulaNotes
Excel=FREQUENCY(A2:A9,C2:C3)FREQUENCY(data, bin edges). Returns one more count than bins (the overflow). Spills in 365.
Google Sheets=FREQUENCY(A2:A9,C2:C3)Identical.
LibreOffice Calc=FREQUENCY(A2:A9,C2:C3)Identical.

How it works

FREQUENCY counts how many data values fall into each bin defined by the bin-edge list: with edges 10 and 20, it returns three counts — values <=10 (3: the 5, 8, 3), values 11-20 (3: the 12, 18, 15), and values >20 (2: the 22, 25). Note it always returns ONE MORE result than there are bins, for the overflow above the last edge. In older Excel you selected the whole output range and entered it with Ctrl+Shift+Enter; in modern versions it spills automatically. Pair the counts with a bar chart for an instant histogram. COUNTIFS with range bounds does the same job one bin at a time if you prefer explicit control.

Verified, not just documented

We ran =FREQUENCY(A2:A9,C2:C3) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 3, 3, 2 — exactly the expected result. Every formula here is confirmed by actually executing it.