← All how-to recipes

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

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

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

The formula

AppFormulaNotes
Excel (desktop)=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. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 3, 3, 2 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

FREQUENCY — see full Excel, Google Sheets & LibreOffice compatibility for each.