The Excel MEDIAN function calculates the median of a given set of numbers, which is the middle value in a sorted list.