# Median (PEL)

This function calculates the median value of a numeric expression that is evaluated over a scope.

```
Median(
Scope_Expression
[ , Numeric_Expression ]
)
```

#### Parameters

- Scope_Expression

A valid PerformancePoint Expression Language (PEL) expression that returns a scope.

- Numeric_Expression

A valid numeric expression that is typically a PEL expression of cell coordinates that return a number.

## Return Value

If a numeric expression is specified, the function evaluates the specified numeric expression across the scope. The function then returns the median value from that evaluation.

If a numeric expression is not specified, the function evaluates the specified set in the current context of the members of the set. The function then returns the median value from that evaluation.

## Remarks

The median value is the middle value in a set of ordered numbers. (The median value is unlike the mean value, which is the sum of a set of numbers divided by the count of numbers in the set). The median value is determined by selecting the smallest value so that at least half of the values in the set are no greater than the chosen value. If the number of values in the set is odd, the median value corresponds to a single value. If the number of values in the set is even, the median value corresponds to the sum of the two middle values divided by two.

The PEL compiler cannot generate SQL code for this function.