Vous êtes ici: Help Topics > Customization > Calculation > MEDIAN Function

MEDIAN Function

The MEDIAN() function extracts the middle cell value from a range of cells or a sum group; that is, half the cell values have are greater than the median, and half the values are less. If there is an even number of values, then the MEDIAN() function returns the average of the two middle values.

Syntax

MEDIAN(first cell..last cell, step, argument)

If the argument is included and

Argument

Result

0

The function applies to all cells in the sum group or range.

1

The function applies only to cells in the sum group or range whose value is not zero.

A cell with a zero value is a cell that is empty or that contains a blank.

Alternate Syntax

MEDIAN("sum group", argument)

Where...

  • sum group is the label assigned to a sum group of cells.

Example 1

MEDIAN(C701..C705,1,0)

Where...

  • C701 = 53
  • C702 = 45
  • C703 = 0
  • C704 = 48
  • C705 = 43

Here cell C703 is included, so the function returns the value 45.

Example 2

MEDIAN(C701..C705,1,1)

Where...

  • C701 = 93
  • C702 = 95
  • C703 = 98
  • C704 = 0
  • C705 = 92

The number of non-zero numbers is 4, so the function returns the value of the average of two middle non-zero numbers. The value inserted is (93+95)/2, which is 94.

Example 3

MEDIAN(C701..C704,3,0)

Where...

  • C701 = 13
  • C702 = 15
  • C703 = 18
  • C704 = 0
  • C705 = 12
  • C706 = 10

Returns the value of cell C701 and C704 (13+0)/2, which is 6.5. The "3" in the equation designates only every third cell should be included in the calculation, hence C702 and C703 are ignored.

In a document containing a chart of current year, budget and prior years, this option could be used to limit the selection of cells for the equation to every third cell, the current year values, for example.

Example 4

MEDIAN("Sales", 1)

Where...

  • "Sales" is the sum group containing cells with values -100, -113, -114, 115, 121.

Returns the value -100.

Related Topics