Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Frequency Distribution Table Calculator (Relative and Cumulative Frequency, Histogram)

Choose how to enter your data. "From raw data" builds a frequency distribution table from a list of values you paste, and "From a frequency table" lets you type in the lower limit, upper limit and frequency of each class of a table you already have.

Decimals and negative numbers are OK for the data and the lower and upper limits. Frequencies are whole numbers of 0 or more. Each class includes its lower limit and excludes its upper limit.
Result and graph
Enter your data (or a frequency table) in the fields on the left and press "Calculate". The frequency distribution table and a histogram will appear here.

What you can do on this page

  • Paste raw data such as heights, test scores or commute times (separated by commas or spaces), choose the class width and the lower limit of the first class, and a frequency distribution table (class, midpoint, frequency, relative frequency, cumulative frequency, cumulative relative frequency) is made for you
  • You can also enter an existing frequency table (lower limit, upper limit and frequency of each class) directly
  • The mean estimated from the class midpoints ("sum of (midpoint × frequency) ÷ total frequency") is shown both as a fraction in lowest terms (exact) and as a decimal. The mode and the class containing the median are found too
  • A histogram and a frequency polygon are drawn automatically, and you can save them as PNG or SVG
  • A plain-language guide to terms such as class, frequency and relative frequency, and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
Each class includes its lower limit and excludes its upper limit, for example "10 to under 15" means \(10 \le x < 15\). A value exactly on a boundary goes into the higher class.

What is this calculation used for?

Looking at the distribution of test scores (school and education)

Frequency tables and histograms of test scores grouped every 10 points are a standard part of grade reports. Even with the same average of 60 points, a single peak around 60 and two peaks in the 30s and the 90s describe completely different groups of students.
Turn the counts into relative frequencies, and you can fairly compare the distributions of groups of different sizes, such as two sections or two grade levels. The charts on standardized test score reports that show which band your score falls in are built on the same idea of a frequency distribution.

Watching the variation of products (quality control in manufacturing)

The histogram is one of the "seven basic tools of quality" used in manufacturing quality control. Measure the size or weight of products and make a frequency distribution, and you can see the center and the spread of the variation, and whether it is drifting toward the upper or lower specification limit.
If the distribution splits into two peaks, it may mean that two machines are set differently. The shape gives clues for finding the cause of defects.

Reading population and income distributions (government statistics)

The US Census Bureau publishes the population by age group and household income in brackets (such as "$50,000 to $74,999") in the form of frequency tables. For lopsided data such as income, a few large values are known to pull the mean above the median, so an "average income of X dollars" alone can give you the wrong idea.
A frequency table also shows which bracket has the most households (the modal class) and which bracket the middle household is in (the class containing the median), so you can judge from the whole picture of the distribution.

Organizing rainfall and temperature trends (weather and safety)

In weather and climate work, observed rainfall and temperature data are grouped into classes, for example "how many days a year had 1 inch of rain or more". A frequency distribution makes it possible to compare trends between years or regions, and to see changes in how often the extreme classes occur.
Disaster planning is built on this kind of distribution information: how strong an event is, and how often events of that strength happen.

Seeing where you stand (sports and health)

At a checkup, a child's height and weight are plotted on the CDC growth charts, which show percentiles, such as "taller than 75% of children of the same age". Those charts start from the distribution of measurements of many children, and a percentile is the same idea as the cumulative relative frequency: the share of all the data below a value.
The reference ranges for height, weight, blood pressure and other checkup results also start from studying the distribution of data from many people.

Formulas and graph

Relative frequency
Standard notation (the usual math form)
\(\text{relative frequency}\) \(=\) \(\text{frequency}\) \(\div\) \(\text{total frequency}\)
In words (symbols replaced with words)
③ relative frequency of the class \(=\) ① frequency of the class \(\div\) ② total frequency (number of all the values)
The formula in words
① Take the frequency of the class (the number of values in the class)
② divide it by the total frequency (number of all the values)
③ and you get the relative frequency of the class
Quick example
If 6 out of 20 students have a commute time of "10 to under 15 minutes", the relative frequency of this class is
relative frequency of 10 to under 15 min \(=\) frequency of this class (6 students) \(\div\) total frequency (20 students)
\(6 \div 20 = 0.3\)
Key idea
The relative frequency is the share of the whole that a class takes up. Because it is a share, the relative frequencies of all the classes always add up to 1. What makes it useful is that you can compare data with different totals. For example, "6 students" out of 40 and "6 students" out of 20 carry different weight even though both are 6, but as relative frequencies (0.15 and 0.3) they can be compared fairly. Relative frequencies are usually written as decimals (such as 0.05 or 0.30), and sometimes as percents (5% or 30%).
Class midpoint
Standard notation (the usual math form)
\(\text{midpoint}\) \(=\) \((\) \(\text{lower limit}\) \(+\) \(\text{upper limit}\) \()\) \(\div\) \(2\)
In words (symbols replaced with words)
③ midpoint of the class \(=\) \((\) ① lower limit of the class \(+\) ② upper limit of the class \()\) \(\div\) \(2\)
The formula in words
① Add the lower limit of the class (included)
② and the upper limit of the class (not included) and divide by 2 (that is, take the value in the middle),
③ and you get the midpoint of the class
Quick example
The midpoint of the class "10 to under 15 minutes" is
midpoint of 10 to under 15 min \(=\) \((\) lower limit (10 min) \(+\) upper limit (15 min) \()\) \(\div\) \(2\)
\((10 + 15) \div 2 = \dfrac{25}{2} = 12.5\)
Key idea
The class midpoint is the value in the middle of a class. Once data is put into a frequency table, you can no longer tell what each value originally was. So the midpoint stands for the class: "let's treat every value in this class as if it were the middle value". In the next formula (the estimated mean), the midpoint plays the leading role.
Estimating the mean from a frequency table
Graph (histogram and frequency polygon)
Standard notation (the usual math form)
\(\text{mean}\) \(=\) \(\text{sum of (midpoint} \times \text{frequency)}\) \(\div\) \(\text{total frequency}\)
In words (symbols replaced with words)
③ estimated mean \(=\) ① sum of (midpoint × frequency) \(\div\) ② total frequency (number of all the values)
The formula in words
① For each class, work out "midpoint × frequency", and add them all up. Take this sum of (midpoint × frequency)
② divide it by the total frequency (number of all the values)
③ and you get the estimated mean
Quick example
In a simple table with just two classes, "3 people in the class with midpoint 5 and 1 person in the class with midpoint 15", the estimated mean is
estimated mean \(=\) (5 × 3 people) + (15 × 1 person) \(\div\) total frequency (4 people)
\(5 \times 3 + 15 \times 1 = 15 + 15 = 30\)
\(30 \div 4 = 7.5\)
Key idea
The mean is normally "add up all the data and divide by the count". But a frequency table does not tell you each individual value, so you calculate as if every value in a class were equal to the class midpoint. For example, for a class with frequency 6 (midpoint 12.5), \(12.5 \times 6\) stands in for the sum of that class. That is why this mean is an estimate. It can differ slightly from the mean calculated directly from the raw data (when you enter raw data, the calculator on this page shows both side by side, so you can see the difference for yourself).
A frequency distribution table splits data into classes (each including its lower limit and excluding its upper limit) and counts the frequency (number of values) in each. The relative frequency (frequency ÷ total frequency) shows each class's share of the whole, and the class midpoints let you estimate the mean. Draw it as a histogram and you can see at a glance how the data is spread out (its distribution).

Symbols and terms

Symbols

\(n\) n A letter used for the total frequency (the number of all the values), from the first letter of "number".
\(f\) f A letter used for the frequency (the number of values in a class), from the first letter of "frequency".
\(r\) r The letter used for the relative frequency in the copy-and-paste formulas on this page, from the first letter of "relative".
\(a,\ b\) a, b The lower limit (included) and the upper limit (not included) of a class. It is customary to use letters from the start of the alphabet, \(a,\ b,\ c\), for fixed numbers.
\(m\) m The letter used on this page for the class midpoint (the value in the middle of a class), from the first letter of "midpoint" or "middle".
\(\bar{x}\) x-bar The symbol for the mean. A bar, which stands for "mean", is placed over the letter \(x\) that stands for the data values. It is widely used in statistics.

Terms

frequency distribution table A table that splits data into several classes (intervals) and counts how many values (the frequency) fall into each class. It is a basic statistics tool for getting the overall picture (distribution) of the data.
class Each of the intervals the data is divided into (also called a bin). For commute times, for example, it is usual to use intervals of the same width with no gaps, such as "0 to under 5 minutes", "5 to under 10 minutes" and so on.
class width The size of one class. For "10 to under 15 minutes", the width is 5 minutes. Changing the width changes how the table and the histogram look.
class midpoint (midpoint) The value in the middle of a class, found by (lower limit + upper limit) ÷ 2. The midpoint of "10 to under 15 minutes" is 12.5 minutes. It stands for the class when you estimate the mean from a frequency table.
frequency The number of values in a class. It is counted in whatever you are counting, such as people, times or items.
relative frequency The share of the whole that the frequency of a class makes up. It is found by frequency ÷ total frequency and is usually written as a decimal. The relative frequencies of all the classes add up to 1.
cumulative frequency The frequencies from the first class up to that class, all added up. It tells you right away how many values are under a certain value.
cumulative relative frequency The relative frequencies from the first class up to that class, all added up (cumulative frequency ÷ total frequency). It tells you what share of all the data is under a certain value. It reaches 1 at the last class.
lower limit The smallest value of a class, and it is included in the class. This rule removes any doubt about where a value on a boundary goes. The class "10 to under 15" includes a value of exactly 10.
upper limit The value where a class ends, and it is not included in the class. So a value of exactly 15 does not go into "10 to under 15" but into the next class up, "15 to under 20".
histogram A frequency table drawn as a bar-style graph. The classes go on the horizontal axis and the frequencies on the vertical axis, and the rectangular bars are placed side by side with no gaps. You can see at a glance how the data is spread out (the shape of the distribution).
frequency polygon A line graph that connects the middle of the top of each histogram bar (at the class midpoint) in order. At both ends, the line goes down to the horizontal axis as if there were a class with frequency 0. It is handy for laying two distributions on top of each other to compare them.
distribution How the data is spread out - where there are many values and where there are few. Frequency tables and histograms are tools for looking at a distribution.
measure of center A single number that sums up where the data is centered. The mean, the median and the mode are the most common ones.
mean All the data values added up and divided by the number of values. From a frequency table, it is estimated by sum of (midpoint × frequency) ÷ total frequency.
median The value exactly in the middle when the data is sorted from smallest to largest. With an even number of values, it is the mean of the two middle values. With a frequency table, you use the cumulative frequency to find which class the median is in.
mode The value that appears most often. With a frequency table, the midpoint of the class with the highest frequency (the modal class) is taken as the mode.
raw data The individual values just as they were measured, before being summarized. Organizing raw data into a frequency table makes the overall picture easier to see, but the information about each individual value is lost.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.

Inequalities with ≤ and < (Grade 6)
  • Knowing that "10 or more" (\(x \ge 10\)) includes 10, and "less than 15" (\(x < 15\)) does not include 15
  • Being able to tell which numbers fall in a range such as "10 to under 15" and which do not (exactly 15 does not)
The mean (Grade 6)
  • Knowing that the mean is found by sum ÷ count
  • Being able to picture the mean as "how much each person gets when it is shared out evenly"
Ratios and percents (Grade 6)
  • Knowing that a share is found by part ÷ whole (the relative frequency is exactly this share)
  • Being able to switch between a decimal such as 0.3 and a percent such as 30%
Fractions and decimals (Grades 4–6)
  • Being able to turn a fraction into a decimal, as in \(\dfrac{5}{10} = 0.5\)
  • Being able to simplify a fraction (\(\dfrac{6}{20} = \dfrac{3}{10}\))
Measures of center (Grade 6)
  • Being able to explain what the mean, the median and the mode each show
  • Knowing that the median is the middle value of the sorted data, and the mean of the two middle values when there is an even number of values

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the relative frequency
Frequency of a class f 6
Total frequency n 20
Relative frequency r = f ÷ n =B1/B2
Table to find the class midpoint
Lower limit of the class a 10
Upper limit of the class b 15
Midpoint m = (a + b) ÷ 2 =(B1+B2)/2
Table to estimate the mean from a frequency table
Midpoint 1 (0 to under 5) 2.5
Midpoint 2 (5 to under 10) 7.5
Midpoint 3 (10 to under 15) 12.5
Midpoint 4 (15 to under 20) 17.5
Midpoint 5 (20 to under 25) 22.5
Midpoint 6 (25 to under 30) 27.5
Frequency 1 1
Frequency 2 5
Frequency 3 6
Frequency 4 4
Frequency 5 3
Frequency 6 1
Sum of (midpoint × frequency) =SUMPRODUCT(B1:B6,B7:B12)
Total frequency n =SUM(B7:B12)
Estimated mean =B13/B14
Table to count frequencies from raw data (COUNTIFS)
Value 1 3
Value 2 5
Value 3 8
Value 4 12
Value 5 14
Value 6 17
Value 7 22
Value 8 26
Frequency of 0 to under 5 =COUNTIFS(B1:B8,">=0",B1:B8,"<5")
Frequency of 5 to under 10 =COUNTIFS(B1:B8,">=5",B1:B8,"<10")
Frequency of 10 to under 15 =COUNTIFS(B1:B8,">=10",B1:B8,"<15")
After pasting, the upper rows are your inputs and the last rows are calculated automatically.
The first table is an example of relative frequency, and the answer is 0.3. The second table is an example of a class midpoint, and the answer is 12.5.
The third table estimates the mean for the calculator example on this page (commute times of 20 students). SUMPRODUCT is a function that multiplies matching cells and adds the results, so it gives the sum of (midpoint × frequency) in one step. The answer is 14.
The fourth table counts the frequency of each class from raw data. COUNTIFS is a function that counts the cells that meet conditions. Put the two conditions "10 or more" and "less than 15" side by side, and you get the frequency of that class.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the relative frequency
Frequency of a class f 6
Total frequency n 20
Relative frequency r = f ÷ n =B1/B2
Table to find the class midpoint
Lower limit of the class a 10
Upper limit of the class b 15
Midpoint m = (a + b) ÷ 2 =(B1+B2)/2
Table to estimate the mean from a frequency table
Midpoint 1 (0 to under 5) 2.5
Midpoint 2 (5 to under 10) 7.5
Midpoint 3 (10 to under 15) 12.5
Midpoint 4 (15 to under 20) 17.5
Midpoint 5 (20 to under 25) 22.5
Midpoint 6 (25 to under 30) 27.5
Frequency 1 1
Frequency 2 5
Frequency 3 6
Frequency 4 4
Frequency 5 3
Frequency 6 1
Sum of (midpoint × frequency) =SUMPRODUCT(B1:B6,B7:B12)
Total frequency n =SUM(B7:B12)
Estimated mean =B13/B14
Table to count frequencies from raw data (COUNTIFS)
Value 1 3
Value 2 5
Value 3 8
Value 4 12
Value 5 14
Value 6 17
Value 7 22
Value 8 26
Frequency of 0 to under 5 =COUNTIFS(B1:B8,">=0",B1:B8,"<5")
Frequency of 5 to under 10 =COUNTIFS(B1:B8,">=5",B1:B8,"<10")
Frequency of 10 to under 15 =COUNTIFS(B1:B8,">=10",B1:B8,"<15")
The same formulas as in Excel (SUMPRODUCT, COUNTIFS) work as is. Copy the whole table, paste it into cell A1, and replace the numbers with your own data.

How to calculate it in Python

from fractions import Fraction

# raw data (example: commute times of 20 students, in minutes)
data_values = [5, 12, 8, 14, 3, 22, 15, 9, 11, 26,
               7, 14, 19, 6, 13, 24, 10, 16, 21, 18]
class_width = Fraction(5)   # class width
first_lower = Fraction(0)   # lower limit of the first class

data_values = [Fraction(v) for v in data_values]
class_count = max(int((v - first_lower) / class_width) for v in data_values) + 1

# put each value into its class (lower limit included, upper limit not included)
freqs = [0] * class_count
for v in data_values:
    freqs[int((v - first_lower) / class_width)] += 1

total = sum(freqs)
mid_times_freq_sum = Fraction(0)
print("Class / Midpoint / Frequency / Relative frequency")
for i, f in enumerate(freqs):
    lower = first_lower + i * class_width
    upper = lower + class_width
    midpoint = (lower + upper) / 2
    mid_times_freq_sum += midpoint * f
    print(f"{lower} to under {upper} / {float(midpoint)} / {f} / {float(Fraction(f, total))}")

estimated_mean = mid_times_freq_sum / total
print(f"Estimated mean (fraction): {estimated_mean}")
print(f"Estimated mean (decimal): {float(estimated_mean)}")
print(f"Mean of the raw data: {float(sum(data_values) / len(data_values))}")
With the fractions module in the standard library, you can calculate with exact fractions and no decimal rounding errors. This is the calculator example on this page (commute times of 20 students, class width 5). When you run it, it shows each row of the frequency table, the estimated mean "14" and the mean of the raw data "13.65". Change the data and the class settings and run it.

How to write it in LaTeX and other math languages (copy and paste)

Relative frequency
r = f ÷ n
r = \dfrac{f}{n}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>r</mi>
    <mo>=</mo>
    <mfrac><mi>f</mi><mi>n</mi></mfrac>
  </mrow>
</math>
r = f/n
r = f/n
r := f/n;
r = f/n;
r = f/n
Class midpoint
m = (a + b) ÷ 2
m = \dfrac{a + b}{2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>m</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
m = (a + b)/2
m = (a + b)/2
m := (a + b)/2;
m = (a + b)/2;
m = (a + b)/2
Estimating the mean from a frequency table
x̄ = (m₁×f₁ + m₂×f₂ + … + mₖ×fₖ) ÷ n
\bar{x} = \dfrac{m_1 f_1 + m_2 f_2 + \cdots + m_k f_k}{n}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mover><mi>x</mi><mo>&#x00AF;</mo></mover>
    <mo>=</mo>
    <mfrac>
      <mrow>
        <msub><mi>m</mi><mn>1</mn></msub><msub><mi>f</mi><mn>1</mn></msub>
        <mo>+</mo>
        <msub><mi>m</mi><mn>2</mn></msub><msub><mi>f</mi><mn>2</mn></msub>
        <mo>+</mo><mo>&#x22EF;</mo><mo>+</mo>
        <msub><mi>m</mi><mi>k</mi></msub><msub><mi>f</mi><mi>k</mi></msub>
      </mrow>
      <mi>n</mi>
    </mfrac>
  </mrow>
</math>
bar x = (m_1 f_1 + m_2 f_2 + cdots + m_k f_k)/n
Total[m*f]/Total[f]
xbar := add(m[i]*f[i], i = 1..k)/n;
xbar = sum(m.*f)/sum(f);
x̄ = (m_1 f_1 + m_2 f_2 + … + m_k f_k)/n

How to have ChatGPT  do the calculation

You are a calculation assistant for statistics. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

Make a frequency distribution table for the following data, using classes that start at a lower limit of 0 with a class width of 5 (each class includes its lower limit and excludes its upper limit).
Data: 5, 12, 8, 14, 3, 22, 15, 9, 11, 26, 7, 14, 19, 6, 13, 24, 10, 16, 21, 18
Show each of the following:
1. The frequency distribution table (class, midpoint, frequency, relative frequency, cumulative frequency, cumulative relative frequency)
2. The mean estimated from the class midpoints (both as a fraction in lowest terms and as a decimal)
3. The mode and the class that contains the median
4. The mean calculated directly from the raw data, and how far the estimate is from it

In Python, calculate exactly with the fractions module in the standard library, and show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.