How to Use MEDIAN Function in Excel (4 Suitable Examples)

Get FREE Advanced Excel Exercises with Solutions!

While working in Excel, we may need to find the median value in a range of data that actually reflects the median level of the dataset. We can calculate it easily by using the MEDIAN function in MS Excel. This article will guide you with 4 simple examples and proper illustrations to use the MEDIAN function for finding the median of a data range.


Introduction to the MEDIAN Function

Function Objective:

The MEDIAN function is classified under the statistical function. This function returns the median of a group of numbers. That is actually the number in the middle of a set of numbers.

Syntax:

=MEDIAN (number1, [number2], …)

Arguments Explanation:

Arguments Required/Optional Explanation
number1 Required A number or cell reference that refers to numeric values.
number2 Optional A number or cell reference that refers to numeric values.

Using MEDIAN Function: 4 Examples

Let’s introduce the dataset first. My dataset represents some students’ obtained marks in a Mathematics class test out of 20 marks.


Example 1: Use the Excel MEDIAN Function for Odd Number of Data

Take a look at the number of students in our dataset is 7, which is an odd number. Now we want to find the middle number (median) of the series. So, if we use the MEDIAN function here, we can simply find the middle numbers of values in the series. I’ll show the output in cell C13.

MEDIAN Function for Odd Number of Data

Steps: 

⏩ Activate cell C13.

⏩ Type the following formula in it:

=MEDIAN(C5:C11)

⏩ Then just hit the Enter button to get the result.

MEDIAN Function for Odd Number of Data

Now, you will see that we have got the middle value of our data.


Example 2: Apply MEDIAN Function for Even Number of Data

Here, I have added a row to make the series even. Now, I’ll show how to find the median of this series. As it is an even series, the median will be the average of two middle numbers.

Steps: 

⏩ Write the following formula in cell C14:

=MEDIAN(C5:C12)

⏩ Press the Enter button to finish.

MEDIAN Function for Even Number of Data

Now you will spot that the median is the average of the values 14 and 15 for the even series.

MEDIAN Function for Even Number of Data


Example 3: Use MEDIAN Function for Discontinuous Data Range

If the data range is discontinuous, then we can apply the MEDIAN function to find the median. For example, I’ll find the median for the first two and last three numbers of the series, then just select the range individually by using a comma in the MEDIAN function. That means we’ll find the median of the numbers- 10,12,15,18,16.

Steps: 

⏩ In cell C14 type the following formula:

=MEDIAN(C5:C6,C10:C12)

⏩ Finally, just hit the Enter button.

MEDIAN Function for Discontinuous Data Range

Then you will get the output like the image below-

MEDIAN Function for Discontinuous Data Range


Example 4: Combine MEDIAN with IF for Excluding Zero in a Data Range

If you had zero in your data range and you don’t want to include it in the MEDIAN function, then you can use the IF function with the MEDIAN function. The IF function is a logical function that is used to return one value if a condition is true and another value if it’s false. So here, the IF function will exclude zero from the data range by a logical test.

Steps: 

⏩ Write the following formula in cell C14:

=MEDIAN(IF(C5:C12>0,C5:C12))

⏩ Later, just click the Ctrl+Shift+Enter button.

Find the Median Excluding Zero in a Data Range

Here’s our output excluding zero-

Combine MEDIAN with IF for Excluding Zero in a Data Range

Formula Breakdown:

IF(C5:C12>0,C5:C12)
The IF function will check the values if they are greater than zero or not. If greater, then it will return the value otherwise it will return FALSE. So the output will return as-
{10;FALSE;12;15;14;15;18;16}

MEDIAN(IF(C5:C12>0,C5:C12))
Finally, the MEDIAN function will find the median of values extracted from the IF function that returns-
15


Download Practice Workbook

You can download the free Excel template from here and practice on your own.


Conclusion

I hope all of the methods described above will be good enough to use the MEDIAN function in Excel. Feel free to ask any question in the comment section, and please give me feedback.


<< Go Back to Excel Functions | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Md. Sourov Hossain Mithun
Md. Sourov Hossain Mithun

Md. Sourov Hossain Mithun, an Excel and VBA Content Developer at Softeko's ExcelDemy project, joined in October 2021. Holding a Naval Architecture & Marine Engineering degree from BUET, Mithun showcases expertise during his two-year tenure. With over 200 published articles on Excel topics, he earned a promotion to Team Leader, excelling in leading diverse teams. Mithun's passion extends to Advanced Excel, Excel VBA, Data Analysis, and Python programming, contributing significantly to the innovative and dynamic environment of ExcelDemy... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo