Statistical functions
LARGE
Matches all 7 recorded answers
Recorded: 7 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | LARGE |
| Bulgarian | LARGE |
| Czech | LARGE |
| Danish | STØRSTE |
| German | KGRÖSSTE |
| Greek | LARGE |
| English (Australia) | LARGE |
| English (United Kingdom) | LARGE |
| English (United States) | LARGE |
| Spanish | K.ESIMO.MAYOR |
| Estonian | LARGE |
| Finnish | SUURI |
| French | GRANDE.VALEUR |
| Hebrew | LARGE |
| Croatian | LARGE |
| Hungarian | NAGY |
| Indonesian | LARGE |
| Italian | GRANDE |
| Japanese | LARGE |
| Korean | LARGE |
| Lithuanian | LARGE |
| Latvian | LARGE |
| Norwegian | N.STØRST |
| Dutch | GROOTSTE |
| Polish | MAX.K |
| Portuguese (Brazil) | MAIOR |
| Portuguese (Portugal) | MAIOR |
| Romanian | LARGE |
| Russian | НАИБОЛЬШИЙ |
| Slovak | LARGE |
| Slovenian | LARGE |
| Serbian (Latin) | LARGE |
| Swedish | STÖRSTA |
| Thai | LARGE |
| Turkish | BÜYÜK |
| Ukrainian | LARGE |
| Vietnamese | LARGE |
| Chinese (Simplified) | LARGE |
| Chinese (Hong Kong) | LARGE |
| Chinese (Traditional) | LARGE |
Names from Microsoft's support site.
What it does
LARGE(array, k)
LARGE(array, k) returns the k-th largest value of the numeric data in array.
Formally, let x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎ be the admitted values sorted ascending — the order
statistics of the sample. Then
LARGE(array, k) = x₍ₙ₋ₖ₊₁₎
so LARGE(array, 1) is the maximum, LARGE(array, n) is the minimum, and k counts down
from the top. Ties count with multiplicity: in {5, 5, 3} both LARGE(·,1) and
LARGE(·,2) are 5. This is the point most often missed — LARGE is not "the k-th largest
distinct value", and there is no built-in that is.
Domain. 1 ≤ k ≤ n, where n is the count of numeric values actually admitted from
array. k outside that range has no order statistic to name. Range: exactly one of the
input values — LARGE is a selector, and its result is always bit-identical to some element
of the data. No arithmetic is performed, which is the property that distinguishes it from the
percentile family.
That last point deserves emphasis, because it is the whole reason LARGE exists alongside
PERCENTILE.INC. PERCENTILE.INC(array, p) interpolates linearly
between adjacent order statistics and can return a number that appears nowhere in the data.
LARGE never does. If you need "the third-highest actual observation", LARGE is the correct
function and a percentile is not.
The complementary identity with SMALL is exact:
LARGE(array, k) = SMALL(array, n − k + 1)
Arguments
| Argument | Meaning | Admissible values |
|---|---|---|
array | The data set to select from | Array or reference; required |
k | The rank, counted from the largest | Number; required; 1 ≤ k ≤ n |
k is a numeric slot subject to ordinary to-number coercion; array is a scanned collection
governed by the range-scan policy. The expected handling of a non-integer k is truncation
toward zero before the range check, which is the convention the rest of the index-taking
surface uses, but Microsoft's page does not state it on this function and the Handbook has
not confirmed it. See Coercion and lifting.
A subtlety worth stating: n is the count of values that survive the scan, not the number of
cells in the range. Blanks and text in a referenced range are ignored by the usual aggregate
scan policy, so LARGE(A1:A10, 10) over a column with two blanks is an out-of-range request
even though the range has ten cells. That is a common and silent source of #NUM!.
Try it
Quirks
Result and edge cases
Returns Number — one of the input values, unmodified.
k = 1coincides with MAX over the same admitted set, andk = nwith MIN. Whether the three surfaces agree on which bits they return when the extremum is attained by values that compare equal but differ in representation (0and−0) is unverified.knon-integer,k ≤ 0, ork > n→#NUM!as documented.- A direct logical in either slot is coerced by the direct-argument rules —
TRUEbecomes1in both positions — while a logical inside a referenced range is ignored. This is the standard asymmetry of chapter 02, and it meansLARGE(TRUE, TRUE)is a well-formed call. - Error values in
arraypropagate rather than being skipped.
Errors
| Error | Condition | Basis |
|---|---|---|
#NUM! | array is empty, or k < 1, or k exceeds the number of admitted values | Documented by Microsoft on the LARGE page |
#VALUE! | An argument cannot be converted — a non-numeric k, or a directly-passed non-numeric array | Shared coercion rule, chapter 02 |
| propagated | An error value in array | Shared coercion rule, chapter 02 |
How to implement
Numerical notes
LARGE performs no arithmetic, so it has no rounding error and no residual plate worth
drawing. Its entire correctness question is the comparison predicate and the selection
algorithm.
The comparison predicate. Selecting an order statistic requires a total order on the admitted values. Three questions have to be answered and none of them is answered by Microsoft's page:
- Is the comparison raw IEEE-754
<, or is it the tolerant, truncation-style 15-significant-digit comparison that Excel uses in several other families? The reference engine's upstream record documents a family split on exactly this point for the criteria functions. IfLARGEwere tolerant,LARGE({0.3, 0.1+0.2}, 1)andLARGE({0.3, 0.1+0.2}, 2)would be free to return either representation; if it is exact, the two are ordered. - How are
+0and−0ordered? IEEE comparison calls them equal, so a stable selection returns whichever came first in scan order and an unstable one may not. - Excel has no NaN in its value universe, so the usual NaN-ordering trap does not arise — but an implementation built on a generic float comparator has to decide what it does with one anyway, and the safe choice is to make it unreachable.
The selection algorithm. Selecting the k-th largest of n values does not require
sorting. The classical options are:
- Full sort,
O(n log n)— simplest, and for spreadsheet-sized data usually fastest in practice. Must be a stable or at least well-defined sort if the±0question above matters. - Quickselect (Hoare's FIND), expected
O(n), worst caseO(n²)on adversarial input. See Knuth, The Art of Computer Programming volume 3 §5.3.3, and Numerical Recipes §8.5, which presents exactly this problem under the name "selection of the M-th largest". - Median-of-medians (Blum, Floyd, Pratt, Rivest, Tarjan), worst-case
O(n), with a constant large enough that it is rarely the right choice here. - A bounded heap of size
k,O(n log k)— the right choice whenkis small andnis a whole column, which is the common spreadsheet shape.
A recomputation-heavy workbook that calls LARGE(A:A, k) for k = 1…10 in ten cells sorts
the same column ten times unless the engine caches; that is an engine question, not a
function-semantics question, and the Handbook does not assert what Excel does.
The one genuinely numerical remark: because the result is a copy of an input value, LARGE
can never introduce error, and it can never remove it either. LARGE over a column of
computed values inherits whatever error those computations had, and selecting the maximum of a
noisy set is a biased operation — the expected maximum of n samples of a quantity plus noise
exceeds the maximum of the noiseless quantity. That is a statistics observation, not an
implementation defect, and it is the reason "take the best of n runs" is a poor estimator.
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.
LARGE · 1 lines · calc-func/src/catalogue/statistics.rs on GitHub9 large "LARGE" (2, 2) [R "array", V "k"] |s, a, sv| { nth(s, a, sv, true) }
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
- SMALL — the ascending mirror, with the exact index identity given above. The two are the same algorithm with a reversed comparator, and an implementation that does not share code between them is duplicating the delicate part twice.
- MAX / MIN — the
k = 1andk = nspecial cases, with different argument shapes:MAXtakes a variadic argument list,LARGEtakes exactly one array.MAXalso has a documented "returns 0 if there are no numbers" behaviour whereLARGEerrors — the two disagree deliberately on the empty case. - PERCENTILE.INC /
PERCENTILE.EXC/ QUARTILE.INC — the interpolating relatives.PERCENTILE.INCatp = (n−k)/(n−1)equalsLARGE(array, k)exactly, because at the knots the linear interpolation is degenerate. Away from the knots they differ, and that is the whole point. - RANK.EQ / RANK.AVG — the inverse direction:
given a value, return its position.
RANK.EQandLARGEare inverses on data with no ties and are not inverses when ties are present, becauseRANK.EQcollapses tied ranks whileLARGEdoes not. - SORT and TAKE — the modern dynamic-array route to "the top k", which returns all of them at once and makes the tie behaviour visible.
- Confused with:
LARGEandMAXwhen the data contain text — the scan policy decides which values count, and it is the same policy for both, so a disagreement between them is a signal that something else is wrong.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents