TRIMMEAN
Returns the mean after trimming a percentage of values from both tails.
TRIMMEAN sorts numeric data, removes an equal count from low and high ends, then averages the
remaining interior 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
=TRIMMEAN(array, percent)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
array | number (range) | Required | — |
percent | number (range) | Required | — |
Remarks
percentmust satisfy0 <= percent < 1.- The trimmed count per side is
floor(n * percent / 2).
Error cases
- Returns
#NUM!for invalid percent values or when no numeric values are available.
Examples
Trim the smallest and largest observations before averaging.
Formula =TRIMMEAN({1,10,12,13,50},0.4)
Expected result 11.6666666666667
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?.
Compare a smaller fraction whose trimming count rounds down.
Formula =TRIMMEAN({1,10,12,13,50},0.2)
Expected result 17.2
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 zero trim fraction uses every value.
Formula =TRIMMEAN({1,10,12,13,50},0)
Expected result 17.2
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 excluded fraction cannot exceed the full sample.
Formula =TRIMMEAN({1,10,12,13,50},1.1)
Expected result #NUM!
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?.
Trimmed mean from direct values
Formula =TRIMMEAN({1,2,3,4,5,6},0.3333333333333333)
Expected result 3.5
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?.
Trimmed mean from a range
Formula =TRIMMEAN(A1:A6,0.4)
| A | |
|---|---|
| 1 | 10 |
| 2 | 12 |
| 3 | 13 |
| 4 | 20 |
| 5 | 21 |
| 6 | 30 |
Expected result 16.5
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?.