The MEDIAN function is a statistical function used to find the middle value in a set of numbers. To find the median, you first need to sort the numbers in ascending or descending order. If there is an odd number of values, the median is the middle number. If there is an even number of values, the median is the average of the two middle numbers.