Table of Contents
The Median IF function in Google Sheets is a tool that allows users to calculate the median value of a specified range of data based on a given condition. This function is particularly useful for analyzing large datasets and finding the middle value that is not affected by extreme outliers. To perform a Median IF function in Google Sheets, users need to first select the range of data they want to analyze and then input the condition criteria in the formula. The function will then calculate and display the median value that meets the specified condition. This can help users efficiently analyze their data and make informed decisions based on the median value.
Perform a Median IF Function in Google Sheets
You can use the following formula to perform a Median IF function in Google Sheets:
=MEDIAN(IF(GROUP_RANGE=VALUE, MEDIAN_RANGE))
This formula finds the median value of all cells in some range that belong to a certain group.
When you type this formula into a cell, you need to press Ctrl + Shift + Enter since this is an array formula.
The following example shows how to use this function in practice.
Example: Median IF Function in Google Sheets
Suppose we have the following dataset that shows the total points scored by 15 different basketball players:

Now suppose we’d like to find the median of the points scored by players on each team.
To do so, we can use the =UNIQUE() function to first create a list of the unique teams. We’ll type the following formula into cell F2:
=UNIQUE(B2:B16)
Once we press enter, a list of unique team names will be displayed:

Next, we can use the =MEDIAN() function to find the median number of points scored by players on each team.
We’ll type the following formula into cell G2 and press Ctrl + Shift + Enter so Google Sheets knows this is an array formula:
=MEDIAN(IF(B2:B16=F2, C2:C16))

That’s it!
Column F displays each of the unique teams and column G displays the median of the points scored by players on each team.
The following tutorials explain how to calculate other common metrics in Google Sheets:
Cite this article
stats writer (2024). How do I perform a Median IF function in Google Sheets?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-i-perform-a-median-if-function-in-google-sheets/
stats writer. "How do I perform a Median IF function in Google Sheets?." PSYCHOLOGICAL SCALES, 30 Apr. 2024, https://scales.arabpsychology.com/stats/how-do-i-perform-a-median-if-function-in-google-sheets/.
stats writer. "How do I perform a Median IF function in Google Sheets?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-i-perform-a-median-if-function-in-google-sheets/.
stats writer (2024) 'How do I perform a Median IF function in Google Sheets?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-i-perform-a-median-if-function-in-google-sheets/.
[1] stats writer, "How do I perform a Median IF function in Google Sheets?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, April, 2024.
stats writer. How do I perform a Median IF function in Google Sheets?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
