The MEDIAN function in Google Sheets is a powerful tool designed to find the middle value of a numeric dataset. This function is particularly useful when analyzing data sets that may contain outliers or skewed distributions, as it provides a more accurate measure of central tendency than the average. By identifying the median, users can gain valuable insights into their data without being overly impacted by extreme values.
Syntax
MEDIAN(value1, [value2, ...])
- value1: The first numeric value or range from which the median is to be calculated.
- value2: Optional additional numeric values or ranges. You can input multiple ranges or values to include in the median calculation.
Example #1
=MEDIAN(A1:A10)
This function retrieves the median from the range A1 to A10. For example, if the values are 1, 3, 3, 6, 7, 8, and 9, the median would be 6.
Example #2
=MEDIAN(2, 5, 3, 7, 10)
This calculates the median from the set of values provided directly. Given these numbers, the median would be 5.
Example #3
=MEDIAN(B1:B5, C1:C5)
This function finds the median from two ranges, B1 to B5 and C1 to C5. If B1:B5 contains 4, 5, 7, and C1:C5 contains 1, 2, 3, the overall median would be 4.
Error handling
- DIV/0!: This error occurs when there are no numeric values in the provided range, making it impossible to calculate a median.
- VALUE!: This error appears if any of the input arguments are non-numeric, which prevents the function from executing correctly.
- N/A: This message arises when the function is unable to find a median because all values are excluded or invalid.