median

median(a, b, c, ...)

median(A)

Try it yourself:


Find the middle value with median

median returns the central value of ordered numeric data, or the average of the two central values for an even number of observations. It is a robust measure of typical value.

Why use median

For 1, 3, and 100, the median is 3 while the mean is pulled upward. Use sort to inspect ordering, quantileSeq for other percentiles, and mad for robust spread.

Caveats

Median needs comparable numeric values and a non-empty collection. It does not describe multimodal data; use mode when the most frequent value is the question.

Try Median in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions