<doc>
  <legacy_id>2187</legacy_id>
  <name>median</name>
  <type>function</type>
  <syntax>
    <example>median(<i>numbersList</i>)</example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Math, Logic, &amp; Dates</category>
  </classification>
  <references>
    <function tag="average">average Function</function>
    <function tag="standardDeviation">standardDeviation Function</function>
  </references>
  <history>
    <introduced version="1.1">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary><glossary tag="return">Returns</glossary> the median (middle number) of a list of numbers.</summary>
  <examples>
    <example>median(6,22,8) <code><i>-- returns 8</i></code></example>
    <example>put median(incomeLevels) into field "2001 Median Income"</example>
  </examples>
  <description>
    <p>Use the <b>median</b> <control_st tag="function">function</control_st> to find the <function tag="value">value</function> that best represents a group of <glossary tag="value">values</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>numbersList</i> is a comma-separated list of numbers, or an <glossary tag="expression">expression</glossary> that <glossary tag="evaluate">evaluates</glossary> to such a list, or an array containing only numbers.</p><p/><p><b>Value:</b></p><p>The <b>median</b> function <glossary tag="return">returns</glossary> a number.</p><p/><p><b>Comments:</b></p><p>If the number of items in the <i>numbersList</i> is odd, the <b>median</b> <control_st tag="function">function</control_st> returns the middle value of the list when it is sorted in numeric order. If the number of items is even, the <b>median</b> <control_st tag="function">function</control_st> takes the two middle values and averages them to produce the median.</p><p/><p>If the list consists of fewer than three numbers, or if the numbers are evenly distributed, the <b>median</b> is equal to the <function tag="average">average</function>.</p>
  </description>
</doc>