# Mean, Median, Mode Calculator

Find the mean, median, and mode of a data set along with other information such as the total sum, count, min, max, and range values.

Separate numbers using a comma (,)

## Summary Statistics:

### Sorted Data:

Learn how we calculated this below

## How to Calculate Mean, Median, and Mode

Mean, median, and mode are different ways to measure the center of a data set; this is referred to as the central tendency.

The mean is the average of the data, the median is the middle, and the mode is the number with the highest frequency of occurrences. The data represented in the graph below highlights the differences between these statistics. These summary statistics provide information on a data set and are commonly used in mathematics. The minimum value, maximum value, sum, count, range, and standard deviation are some other frequently used summary statistics for data sets. ### How to Find the Mean

In statistics, the mean is the average value of a set of numbers. It’s also referred to as the arithmetic mean. Note that there are some other types of mean that are not covered here, including the geometric mean, weighted mean, and harmonic mean.

The sample mean is denoted (x-bar) and the population mean is denoted μ (mu).

To find the mean, add up all of the numbers to find the sum, then divide the sum by the number of values in the set.

This is the mean formula:

\text{mean}=\frac{\sum_{i=1}^{n}x_{i}}{n}

Where:
n = total number of values in the set

For example: Let’s find the mean for a given data set [1,2,3,4]

\text{sum}=1+2+3+4=10
\text{count }(n)=4
\text{mean}=\frac{10}{4}=2.5

So, the mean of the set [1,2,3,4] is 2.5. ### How to Find the Median

The median is the middle number in an ordered set of numbers. If the count of numbers in the set is even, then the median is the mean of the middle values.

To find the median of a data set, start by sorting the set in ascending order, and then count the values. The formula to calculate the median is different for data sets with odd and even numbers of values.

#### Median Formula for Datasets With Odd Numbers

For a sorted dataset with an odd number of values, use the following median formula:

\text{median}=\left ( \frac{n + 1}{2} \right )^{th}\text{ term}

The median is equal to the (n + 1)/2th term in the dataset, which is the number at the index of the count of the data n plus 1, divided by 2. So the median is the number exactly in the middle when the count is odd.

For example: let’s find the median for the following set containing an odd number of values [1,3,5,7,15,22,29]

\text{count }(n)=7
\text{median}=\left ( \frac{7 + 1}{2} \right )^{th}\text{ term}
\text{median}=4^{th}\text{ term}

So, the median is the fourth term in the set, which is 7.

#### Median Formula for Datasets With Even Numbers

If the count of the numbers is even, then the median is actually the average of the middle two numbers in the data.

For a sorted dataset with an even number of values, use the following median formula:

\text{median}=\frac{\left ( \frac{n}{2} \right )^{th}\text{ term} + \left ( \frac{n}{2} + 1 \right )^{th}\text{ term}}{2}

The median is equal to the n/2th term plus the (n/2) + 1th term, divided by 2.

So, to find the median, find the two numbers in the middle by dividing the count by 2 to find the lower-middle index, then adding 1 to find the upper-middle index.

Then, add the numbers at the lower and upper-middle indices and divide the result by 2. The median for an even dataset is actually the mean of the middle two values.

For example: let’s find the median for the following set of numbers [1,3,5,7,15,22,29,38]

\text{count }(n)=8
\text{median}=\frac{\left ( \frac{8}{2} \right )^{th}\text{ term} + \left ( \frac{8}{2} + 1 \right )^{th}\text{ term}}{2}
\text{median}=\frac{ 4^{th}\text{ term} + 5^{th}\text{ term}}{2}
\text{median}=\frac{7 + 15}{2}
\text{median}=\frac{22}{2}
\text{median}=11

So, the median of this even dataset is 11 ### How to Find the Mode

The mode is the number that occurs most frequently in a set of numbers. To find the mode, count the number of times each number in the set occurs. The number with the greatest count is the mode.

A set of data can have more than one mode if each of the modes occur the same number of times. To be a mode, the number(s) must occur at least twice.

You can use the following formula to find the mode:

\text{mode }= L + \left ( \frac{f_{1}-f_{m}}{2f_{1}-f_{m}-f_{2}} \right ) \times h

Where:
L = lower limit of the modal class
fm = frequency of the modal class
f1 = frequency of the class preceding the modal class
f2 = frequency of the class succeeding the modal class
h = size of the class interval

For example: let’s find the mode for the following set of numbers [1,2,2,3,5,5,7]

1 occurs one time
2 occurs two times
3 occurs one time
5 occurs two times
7 occurs one time

Since 2 and 5 occur at the highest frequency, they are the mode. ### How to Find the Range

The range describes the variance between the numbers in the set, or the difference between the largest and smallest number. It’s the difference between the smallest and largest numbers in a set of numbers.

To calculate the range, find the largest and smallest numbers in the set, then subtract the smallest number from the largest number. You can use the range formula to find it:

\text{range }=\text{ max}-\text{ min}

For example: let’s find the range for the following set of numbers [3,7,22,54]

smallest number (min) = 3
largest number (max) = 54

\text{range }=54-3=51

Since the data spans from a minimum value of 3 to a maximum value of 54, the range is 51. ## References

1. US National Library of Medicine | National Institutes of Health, Measures of central tendency: Median and mode, https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3157145/
2. Holmes, A., Illowsky, B., Dean, S., Introductory Business Statistics - 2.4 Sigma Notation and Calculating the Arithmetic Mean, https://openstax.org/books/introductory-business-statistics/pages/2-4-sigma-notation-and-calculating-the-arithmetic-mean