Lookups, Intersection and Spills
Approximate lookup search paths
An approximate lookup assumes sorted input. Formulon follows the rows Excel actually reads, so an unsorted range returns what Excel returns. With A1:A3 holding 30, 10, 20, =MATCH(15,A1:A3,1) is 2 (golden: match_unsorted_with_approx, zero tolerance). This pins one observed search path; unsorted input is still not a valid substitute for the sorted input an approximate lookup requires.
A whole-column reference is searched over its declared length, the blank cells past the data included, so it reads different rows from the bounded range. With C1:C4 holding 10, 20, 30, 1 and D1:D4 holding 100 to 400:
| Formula | Excel |
|---|---|
=MATCH(15,C1:C4,1) | 1 |
=MATCH(15,C:C,1) | 4 |
=LOOKUP(15,C1:C4,D1:D4), =VLOOKUP(15,C1:D4,2,TRUE) | 100 |
=LOOKUP(15,C:C,D:D), =VLOOKUP(15,C:D,2,TRUE) | 400 |
The cases are in the lookup_approx_whole_axis golden, at zero tolerance.
The same lookup, bounded and whole-column
C1:C4 holds 10, 20, 30, 1 and D1:D4 holds 100 to 400. Column F shows each result and column G the formula. The bounded range stops at C4 and gives 1 and 100; the whole column also reads the blank cells past the data and gives 4 and 400. A1:A3 (30, 10, 20) gives 2.
Powered by the real Formulon engine (WASM) — it runs entirely in your browser, nothing is uploaded.
MATCH takes lookup_array only as a range or an array: =MATCH(1,1,0) and =MATCH(1,1/(A1<>""),0) return #N/A, while a one-cell reference and {1} count as a one-cell range.
A blank lookup value
The two lookup families read a blank or omitted lookup value differently:
VLOOKUP, HLOOKUP, MATCH, LOOKUP | XLOOKUP, XMATCH | |
|---|---|---|
| A blank lookup value is read as | 0 | Blank |
| It finds | A 0 key, never a blank, "0" or "" key | A blank key, not a 0 key |
| In ordered modes | A blank sorts above numbers, text, logical values and errors |
In both families "" finds only a "" key, and 0 never finds a blank.
Implicit intersection
Implicit intersection and spills
A range in a place that expects one value is reduced to the cell in the formula's own row or column. The @ operator asks for this explicitly. A formula that returns several values spills them into the cells below and to the right; if any of those cells is occupied, the formula returns #SPILL!.
Implicit intersection in row 1
Select C1 to see =@A1:A5, which returns A1 because the formula's own row picks the cell. Select E1 to see =@A3:A8, which is #VALUE! because that range has no cell in row 1.
Powered by the real Formulon engine (WASM) — it runs entirely in your browser, nothing is uploaded.
A one-cell range is the exception: =@D1:D1 returns D1 from any row or column, and 0 when D1 is blank.
What blocks a spill
- A cell holding
=""looks empty, but it blocks a spill. - A merged cell blocks a spill too, except that a one-cell result can sit at the top-left cell of a merge.
References selected by a function
IF and CHOOSE pass the reference they select through, a 3-D reference included; IFS and SWITCH do not. With Sa!A1 = 3 and Sb!A1 = 4 (golden: selected_arm_3d):
| Formula | Excel |
|---|---|
=SUM(IF(TRUE,Sa:Sb!A1)) | 7 |
=SUM(CHOOSE(1,Sa:Sb!A1)) | 7 |
=SUM(IFS(TRUE,Sa:Sb!A1)) | #VALUE! |
=SUM(SWITCH(1,1,Sa:Sb!A1)) | #VALUE! |
Functions lifted over arrays
When a function that takes one value receives an array, it returns one result per element. Each element follows Excel's rules by itself:
Lookups
In =VLOOKUP(A1:A2,D1:E2,3,FALSE), a key that is already an error returns that error, even though the column index 3 is invalid for every element. =LOOKUP({100;5},A1:A3,B1:B3) searches each key on its own and returns a column of two results, with an error key staying in its own position.
The WORKDAY and NETWORKDAYS families
In WORKDAY, WORKDAY.INTL, NETWORKDAYS and NETWORKDAYS.INTL, an array in the start, days or end argument lifts: =WORKDAY(45292,{1,2}) spills two dates. A multi-cell reference there does not: =WORKDAY(45292,A1:A2) is #VALUE!, while the computed array =WORKDAY(45292,A1:A2*1) spills. The weekend argument of the .INTL forms lifts over an array or a reference alike; the holidays argument is always one list. An error in another argument fills every element: =WORKDAY(NA(),{1,2}) returns #N/A twice. An error element in an .INTL weekend array counts as an invalid weekend, #NUM! for WORKDAY.INTL and #VALUE! for NETWORKDAYS.INTL.
TAKE and DROP
An array or multi-cell reference as the row or column count returns one result per count, each the top-left cell of the slice it selects: =TAKE({1,2;3,4},{1;2}) returns {1;1}. A count that leaves nothing is #CALC!, so =DROP({1,2;3,4},{1;2}) returns {3;#CALC!}. Under an array count, an error source fills every element with that error, and a reference source, as in =TAKE(A1:B2,{1;2}), returns #VALUE! in every element.
ROW and COLUMN over a value array
Over a value array, such as an IF result rather than a reference, an #N/A element stays #N/A and any other element is #VALUE!, so =SUM(ERROR.TYPE(ROW(IF({1;0;1}=1,{5;6;7},NA())))) is 13 (golden: row_column_values).
Checked against Excel
The Excel column was captured from a real Excel build. The Formulon column is what the WASM engine in this page returns for the same formula under the same profile.
Powered by the real Formulon engine (WASM) — it runs entirely in your browser, nothing is uploaded.
Read next
- Dynamic arrays — spill ranges, anchors and
#SPILL!in the workbook model. - Edits and saves — what has to agree after the next edit or save.