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.

**Table of Contents**Expand

**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**.

**Steps: **

⏩ Activate cell** C13**.

⏩ Type the following formula in it:

`=MEDIAN(C5:C11)`

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

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.

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

**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.

Then you will get the output like the image below-

**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.

Here’s our output excluding zero-

⏬** 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**