Mean, Median, and Mode: Finding the Centre of Your Data

If you hand someone a spreadsheet with 10,000 different salaries, their eyes will glaze over. The human brain is not designed to process raw, massive lists of numbers.

To make sense of data, we have to summarize it. The most common way to summarize a dataset is to find its center point. In statistics, this is called finding the Measure of Central Tendency. We want to know: What does the “typical” or “average” data point look like?

There are three primary ways to find the center of your data: the Mean, the Median, and the Mode. Knowing which one to use is the difference between telling the truth and accidentally lying with statistics.

1. The Mean (The Mathematical Average)

When most people say “average,” they are talking about the Mean.

To calculate the Mean, you add up every single value in your dataset and divide that total by the number of items you have. In formal mathematical notation, the sample mean xΜ„ is written as:

$$ \bar{x} = \frac{\sum x_i}{n} $$
  • When to use it: The Mean is the gold standard for Interval and Ratio data (continuous numbers like height, weight, or test scores).
  • The Advantage: It is the only measure that uses every single piece of information in your dataset. Every number contributes to the final answer.
  • The Fatal Flaw: It is extremely sensitive to outliers. If nine people in a room make $50,000 a year, and a billionaire walks in, the Mean will instantly skyrocket. The Mean will tell you that the “typical” person in that room is a multi-millionaire, which is completely false.

2. The Median (The Middle Ground)

The Median is the exact middle point of your data.

To find it, you line up all your data points from smallest to largest. The number sitting dead center is your Median. If you have an even number of data points, you take the Mean of the two middle numbers.

  • When to use it: The Median is perfect for Ordinal data (ranked categories) and skewed Ratio data (like income or house prices).
  • The Advantage: It is completely immune to outliers. If that billionaire walks into the room, the Median salary barely moves. Because it relies on rank rather than pure mathematical magnitude, it gives a much more honest picture of highly skewed data.
  • The Fatal Flaw: It throws away data. The Median doesn’t care if the highest number is 100 or 1,000,000. By ignoring the magnitude of the extremes, you might miss important information.

3. The Mode (The Most Popular)

The Mode is simply the value that appears most frequently in your dataset.

If your dataset is [2, 4, 4, 4, 7, 9], your Mode is 4.

  • When to use it: The Mode is the only measure of central tendency you are legally allowed to use for Nominal data (unordered categories like eye color, car brands, or Zip Codes).
  • The Advantage: It is incredibly easy to understand. When you look at a bar chart, the Mode is simply the tallest bar.
  • The Fatal Flaw: It can be chaotic. Sometimes a dataset has no Mode (every number appears exactly once). Sometimes a dataset has two Modes (Bimodal), or three (Trimodal). For continuous numbers (like exact measurements to the third decimal place), the Mode is often completely useless.

The Cheat Sheet: Which one should you use?

Choosing the right measure depends entirely on the “Level of Measurement” (the NOIR framework) of your data, and whether you have extreme outliers hiding in your numbers.

Data Type / SituationBest Measure of CenterWhy?
Nominal (Categories, Names)ModeYou cannot mathematically calculate the middle or average of “Blue” and “Brown.”
Ordinal (Rankings)MedianYou can find the middle rank, but the distances between ranks aren’t equal.
Continuous (Symmetrical, Clean)MeanThe data is clean, so you should use the most mathematically powerful tool available.
Continuous (Skewed, Outliers)MedianThe outliers will break the Mean. The Median tells the honest story.

How to Calculate the Center in Excel, Python, and R

In the real world, you will almost never calculate these by hand. Here is how to quickly find the Mean, Median, and Mode using the most popular data tools.

Microsoft Excel

Excel has built-in formulas for all three measures. Assuming your data is in cells A1 through A10:

  • Mean: Type =AVERAGE(A1:A10)
  • Median: Type =MEDIAN(A1:A10)
  • Mode: Type =MODE.SNGL(A1:A10) (Note: If you suspect your data has more than one mode, you can use =MODE.MULT(A1:A10)).

Finding the center of your data is the first step in Descriptive Statistics, but it is only half the story. If the Mean tells you where the center is, you still need to know how far the rest of your data is spread out from that center. We will tackle that in the next lesson.

Python

If you are using Python, the easiest way to calculate these is by using the built-in statistics module, or the popular pandas library if you are working with a dataframe.

import statistics

data = [2, 4, 4, 4, 7, 9, 100]

# Calculate Mean, Median, and Mode
print(statistics.mean(data))   # Output: 18.57
print(statistics.median(data)) # Output: 4
print(statistics.mode(data))   # Output: 4

R

R is built specifically for statistics, so finding the mean and median takes only a few keystrokes. However, base R famously does not have a built-in function for the Mode, so you have to use a quick workaround.

data <- c(2, 4, 4, 4, 7, 9, 100)

# Calculate Mean and Median
mean(data)   # Output: 18.57143
median(data) # Output: 4

# Calculate Mode (Using the DescTools package)
install.packages("DescTools")
library(DescTools)
Mode(data)   # Output: 4

πŸ—ΊοΈ Part of Path 2: Descriptive Statistics

You are reading step 1 of our module on summarising data. Continue your journey below or view the full syllabus.

Next Lesson β†’
Variance & Standard Deviation