# WorksheetFunction.Median (Excel)

Returns the median of the given numbers. The median is the number in the middle of a set of numbers.

If there is an even number of numbers in the set, Median calculates the average of the two numbers in the middle. Arguments can either be numbers or names, arrays, or references that contain numbers. Logical values and text representations of numbers that you type directly into the list of arguments are counted. If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included. Arguments that are error values or text that cannot be translated into numbers cause errors.

**Median** (Arg1, Arg2, ..., Arg30)

```
Dim dblMedian As Double
dblMedian = WorksheetFunction.Median(Arg1:=)
```