Formualizer Docs

MEDIAN

Returns the middle value of a numeric data set.

For an even number of values, MEDIAN returns the average of the two center values.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=MEDIAN(number1, [number2], ...)

Arguments

ArgumentTypeRequiredDefault
number1number (range)Required—
number2number (range)Optional—

Accepts a variable number of arguments. Minimum: 1.

Remarks

  • Ignores non-numeric values in referenced ranges.
  • Supports both scalar arguments and range inputs.

Error cases

  • Returns #NUM! when no numeric values are available.

Examples

Find the middle value of 4, 8 and 12.

Formula =MEDIAN(4,8,12)

Expected result 8

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Pass one three-element array to compute the middle value.

Formula =MEDIAN({4,8,12})

Expected result 8

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The single observation occupies the middle position.

Formula =MEDIAN(7)

Expected result 7

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A division error among 4 and 12 prevents computing the middle value.

Formula =MEDIAN(4,1/0,12)

Expected result #DIV/0!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Median of an odd-sized set

Formula =MEDIAN(1,3,8)

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Median of an even-sized range

Formula =MEDIAN(A1:A4)

Input cells
A
11
22
310
412

Expected result 6

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

When does MEDIAN return #NUM!?

MEDIAN returns #NUM! when no numeric values are available after filtering/coercion.

Implementation

Engine source

On this page