Calculate Mean, Median
and Mode
Descriptive Analytics
How to calculate mean in Excel
• Arithmetic mean, also referred to as average, is probably the measure
you are most familiar with. The mean is calculated by adding up a group
of numbers and then dividing the sum by the count of those numbers.
• For example, to calculate the mean of numbers {1, 2, 2, 3, 4, 6}, you add
them up, and then divide the sum by 6, which yields 3:
(1+2+2+3+4+6)/6=3.
In Microsoft Excel, the mean can be calculated by
using one of the following functions:
• AVERAGE- returns an average of numbers.
• AVERAGEA - returns an average of cells with any data (numbers,
Boolean and text values).
• AVERAGEIF - finds an average of numbers based on a single criterion.
• AVERAGEIFS - finds an average of numbers based on multiple criteria.
=AVERAGE(C2:C8)
• Simple formula in a sales report
(please see the screenshot below),
supposing you want to get the
average of values in cells C2:C8.
• =AVERAGE( array of numbers )
=AVERAGEIF(A2:A8, "Banana", C2:C8)
• AVERAGEIF formula to get
the average of only "Banana"
sales.
=AVERAGEIFS(C2:C8,A2:A8,
"Banana", B2:B8, "Delivered")
• AVERAGEIFS formula to
calculate the mean based on
2 conditions, say, the average
of "Banana" sales with the
status "Delivered”.
How to find median in Excel
• Median is the middle value in a group of numbers, which are arranged in
ascending or descending order, i.e. half the numbers are greater than the
median and half the numbers are less than the median. For example, the
median of the data set {1, 2, 2, 3, 4, 6, 9} is 3.
How to find median in Excel
• This works fine when there are an odd number of values in the group. But
what if you have an even number of values? In this case, the median is the
arithmetic mean (average) of the two middle values. For example, the
median of {1, 2, 2, 3, 4, 6} is 2.5. To calculate it, you take the 3rd and 4th
values in the data set and average them to get a median of 2.5.
=MEDIAN(C2:C8)
• In Microsoft Excel, a median is calculated by using the MEDIAN
function. Formula to get the median of all amounts in our sales report.
To make the example more illustrative, the numbers are sorted in
column C in ascending order (though it is not actually required
for the Excel Median formula to work):
MEDIAN IF formula (with one condition)
MEDIAN IFS formula (with multiple criteria)
• In contrast to average, Microsoft Excel does not provide any special
function to calculate median with one or more conditions. However, you
can "emulate" the functionality of MEDIANIF and MEDIANIFS by using
a combination of two or more functions.
MEDIAN(IF(criteria_range=criteria, median_range))
Excel MEDIAN IF formula with one criterion
=MEDIAN(IF($A$2:$A$10=$E2, $C$2:$C$10))
• In our sample table, to find
a median amount for a
specific item, input the item
name in some cell, say E2,
and use the formula to get
the median based on that
condition.
=MEDIAN(IF($A$2:$A$10=$E2, $C$2:$C$10))
• The formula tells Excel to calculate only those numbers in column C (Amount) for
which a value in column A (Item) matches the value in cell E2.
• Please pay attention that we use the $ symbol to create absolute cell references. It is
especially important if you intend to copy your Median If formula to other cells.
• Finally, since you want to check every value in the specified range, make it an array
formula by pressing Ctrl + Shift + Enter. If done correctly, Excel will encapsulate the
formula in curly braces like shown in the screenshot below.
MEDIAN(IF(criteria_range=criteria,
median_range))
• Excel Median IFS formula with multiple criteria
=MEDIAN(IF($A$2:$A$10=$E2, $C$2:$C$10))
• In our sample table, to find a median amount for a specific item, input the
item name in some cell, say E2, and use this formula to get the median
based on that condition.
• The formula tells Excel to calculate only those numbers in column C
(Amount) for which a value in column A (Item) matches the value in cell
E2.
Example
How to calculate mode in Excel
• Mode is the most frequently occurring value in the dataset. While the
mean and median require some calculations, a mode value can be found
simply by counting the number of times each value occurs.
=MODE(C2:C8)
• For example, the mode of
the set of values {1, 2, 2, 3,
4, 6} is 2. In Microsoft
Excel, you can calculate a
mode by using the function
of the same name, the
MODE function. For our
sample data set, the formula
goes as follows:
End of the Presentation