Question: I've recently discovered that you can use `SUBTOTAL` for various functions which allow you to sum up or find totals of a column, even whilst there are filters being applied to it.

However, the list of functions `SUBTOTAL` has does not include `MEDIAN`.

Is it possible to find the median of a column of numbers taking into that some rows have filtered out?

Answer: 
Updated to pick up comments from lori\_m below

**1. Original answer - all xl versions**  

Courtesy of [Aladin Akyurek from this solution](http://www.pcreview.co.uk/forums/subtotal-using-median-functoin-t1753713.html)
If your data was in A1:A10, array enter this formula with [shift](/questions/tagged/shift "show questions tagged 'shift'")[ctrl](/questions/tagged/ctrl "show questions tagged 'ctrl'")[enter](/questions/tagged/enter "show questions tagged 'enter'")
`=MEDIAN(IF(SUBTOTAL(3,OFFSET(A1:A10,ROW(A1:A10)-MIN(ROW(A1:A10)),,1)),A1:A10))`

**2. Updated answer (non-array) - all xl versions**
`=MEDIAN(IF(SUBTOTAL(3,OFFSET(A1:A10,MMULT(ROW(A1:A10),1)-MIN(MMULT(ROW(A1:A10),1)),,1)),A1:A10))`

**3. Excel 2010 & Excel 2013**  

`=AGGREGATE(12,5,A1:A10)`
True, `SUBTOTAL` does not include `MEDIAN` but you can obtain it by first using the `SUBTOTAL` and then **substituting a part of the Excel formula** in several or more columns/cells where you need the `MEDIAN`.

Imagine you used `AVERAGE` in the Excel subtotal function, then the formula would be for instance =SUBTOTAL(1;E10:E12)
Now, replace all occurrences of **`"SUBTOTAL(1;"`** with **`"MEDIAN("`** (without the quotes).