Statistical functions
SMALL
Matches all 6 recorded answers
Recorded: 6 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | SMALL |
| Bulgarian | SMALL |
| Czech | SMALL |
| Danish | MINDSTE |
| German | KKLEINSTE |
| Greek | SMALL |
| English (Australia) | SMALL |
| English (United Kingdom) | SMALL |
| English (United States) | SMALL |
| Spanish | K.ESIMO.MENOR |
| Estonian | SMALL |
| Finnish | PIENI |
| French | PETITE.VALEUR |
| Hebrew | SMALL |
| Croatian | SMALL |
| Hungarian | KICSI |
| Indonesian | SMALL |
| Italian | PICCOLO |
| Japanese | SMALL |
| Korean | SMALL |
| Lithuanian | SMALL |
| Latvian | SMALL |
| Norwegian | N.MINST |
| Dutch | KLEINSTE |
| Polish | MIN.K |
| Portuguese (Brazil) | MENOR |
| Portuguese (Portugal) | MENOR |
| Romanian | SMALL |
| Russian | НАИМЕНЬШИЙ |
| Slovak | SMALL |
| Slovenian | SMALL |
| Serbian (Latin) | SMALL |
| Swedish | MINSTA |
| Thai | SMALL |
| Turkish | KÜÇÜK |
| Ukrainian | SMALL |
| Vietnamese | SMALL |
| Chinese (Simplified) | SMALL |
| Chinese (Hong Kong) | SMALL |
| Chinese (Traditional) | SMALL |
Names from Microsoft's support site.
What it does
SMALL(array, k)
SMALL(array, k) returns the k-th order statistic of the numeric values in array,
counting from the bottom.
Let the numeric values of array, sorted ascending, be x_(1) <= x_(2) <= … <= x_(n). Then
SMALL(array, k) = x_(k)
for 1 <= k <= n, and #NUM! otherwise.
This is selection, not estimation. Unlike PERCENTILE.INC or
QUARTILE.INC, SMALL performs no interpolation: the result is always a
value that actually occurs in the data, returned unchanged. That property is the reason to reach
for it — when a report must cite a real observation rather than a computed quantile, SMALL is
the function that guarantees it.
The two ends are the familiar aggregates:
SMALL(A, 1) = MIN(A) SMALL(A, n) = MAX(A)
and the ascending/descending duality with LARGE is exact:
SMALL(A, k) = LARGE(A, n - k + 1)
where n is the count of numeric values, which is COUNT(A) and not the size of the range.
That last qualification is where the identity is usually got wrong in practice: a range with text
labels in it has an n smaller than its cell count, and a formula written as
LARGE(A, ROWS(A)-k+1) silently indexes the wrong statistic.
Ties are not deduplicated. SMALL indexes the sorted multiset, not the sorted set of distinct
values. On {5, 5, 5}, SMALL(A, 2) is 5, not an error and not the second distinct value.
Readers wanting the second distinct smallest need a different construction entirely.
SMALL is monotone non-decreasing in k, and monotone non-decreasing in each data value — it is
an order-preserving selector, which is what makes it safe to compose with itself.
Arguments
| Argument | Meaning | Required |
|---|---|---|
array | The data set. | yes |
k | The position from the bottom, 1-based. | yes |
array is consumed by scanning. Text, logical values and blank cells reached through a range or
array are skipped rather than converted — they do not become zeros and they do not enlarge n.
Values passed directly as scalars go through ordinary to-number coercion under the dual policy of
coercion and lifting.
Try it
Quirks
Result and edge cases
Returns Number — one of the values from array, returned unchanged.
arraycontains no numeric values.n = 0, so everykfails:#NUM!. A range holding only text produces#NUM!, not#VALUE!.kgreater than the count of numeric values.#NUM!. Note again that the count is of numeric cells, so adding a header row to a range does not increase the admissiblek.kless than 1 after truncation.#NUM!.- Repeated values are indexed as they occur;
ncounts them all. - The result is the stored value, not a rounded one.
SMALLnever computes; whatever double was in the cell is what comes back, including its exact bit pattern. - Errors in
arraypropagate as themselves. arraygiven as a rectangular grid is flattened; shape is irrelevant.SMALLreturns a scalar, not a spilled array, even whenkis array-valued — whether Excel lifts over an array-valuedkin a modern build is a lifting question this page does not settle.
Errors
| Error | Condition | Source |
|---|---|---|
#NUM! | array is empty of numeric values | documented |
#NUM! | k <= 0 | documented |
#NUM! | k exceeds the number of numeric data points | documented |
#VALUE! | k is non-numeric text | shared coercion rule |
| propagated | An error value in array or in k surfaces as that error | shared coercion rule |
How to implement
Numerical notes
SMALL performs no arithmetic on the data. It sorts and it indexes, so there is no rounding
error in the result at all — the returned value is bit-identical to the input value that was
selected. That makes it one of the few statistical functions whose correctness is entirely a
question of ordering and admissibility rather than of accuracy. Three ordering questions
nonetheless deserve attention.
Signed zeros. IEEE-754 defines -0.0 == +0.0 as true and neither as less than the other, so
a data set containing both admits two valid sorted orders and SMALL may return either zero. The
values compare equal and print identically, so this is invisible in a spreadsheet — but it is
visible to any comparison of raw bits, and a vector suite comparing bit patterns must decide
whether it cares. The mathematically honest position is that SMALL is well defined as a
multiset selection and under-determined as a bit selection.
Stability and cost. The kernel performs a full sort, O(n log n), to answer a question
that quickselect answers in expected O(n) — the classical result of Blum, Floyd, Pratt, Rivest
and Tarjan (1973) gives a worst-case linear bound. For a single SMALL over a large column the
sort is the entire cost of the call, and a column of SMALL formulas over the same range re-sorts
the same data once per formula. That is a performance property rather than a correctness one, but
it is the reason a k-th-smallest column is slow and a SORT spill is not, and no amount of
formula rewriting inside SMALL fixes it.
The truncation of k. trunc(k) before validation means the admissible interval for k is
the half-open [1, n+1) rather than the closed [1, n]: k = n + 0.5 truncates to n and
succeeds. Nothing documents this, and the alternative — validate first, then truncate — would
reject it. Which one Excel does is a one-cell experiment nobody has run.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
SMALL · 1 lines · calc-func/src/catalogue/statistics.rs on GitHub10 small "SMALL" (2, 2) [R "array", V "k"] |s, a, sv| { nth(s, a, sv, false) }
Kernels shared with other functions
Argument and result plumbing
No implementation has been published with a Handbook test suite for this function.
Version differences
No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.
Alternatives
Relationships
- LARGE is the descending counterpart, with the exact identity
SMALL(A,k) = LARGE(A, COUNT(A)-k+1). The two are the same selection with the comparison reversed. - MIN is
SMALL(A, 1)and MAX isLARGE(A, 1).MINandMAXare the ones to use for the extremes — they need no count and nok, and they do not error on an empty range (they return0), which is a behavioural difference worth knowing when a range might be empty. - MEDIAN is
SMALL(A, (n+1)/2)for oddnand the mean of the two middle order statistics for evenn. - QUARTILE.INC and PERCENTILE.INC are the
interpolating relatives. They return quantiles, which may be values that occur nowhere in the
data;
SMALLreturns observations. Choosing between them is a choice about what the number is supposed to mean, not a choice of formula. - RANK.EQ is the inverse map:
LARGE(ref, RANK.EQ(x, ref))recoversx, because competition rank and the descending order-statistic index coincide. The ascending version composes withRANK.EQ(x, ref, 1). - SORT and SORTBY return the whole ordering as a spilled
array. Where several order statistics are wanted at once, one
SORTbeats severalSMALLcalls by an order of magnitude in work. - The idiom
SMALL(IF(cond, range), k)is the classic way to get thek-th smallest among rows meeting a condition, and depends on theFALSEbranch producing valuesSMALLskips. - Readers confuse
SMALLwithMINIFS, which returns the minimum under criteria — thek = 1case of the conditional idiom, with the condition expressed properly rather than through an array formula.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents