The category table of ECMA-376 5th edition Part 1 (December 2016) section 18.17.7 lists eighteen lookup and reference functions: ADDRESS, AREAS, CHOOSE, COLUMN, COLUMNS, GETPIVOTDATA, HLOOKUP, HYPERLINK, INDEX, INDIRECT, LOOKUP, MATCH, OFFSET, ROW, ROWS, RTD, TRANSPOSE and VLOOKUP. This page gives each one’s syntax, arguments, return value and worked examples as the standard states them, then [MS-OI29500] v20260818’s notes on what Office does differently, then the result LibreOffice gives for each example. The Formulas page has the grammar (references, ranges, unions, intersections) these functions work on. Section numbers in the headings are the standard’s own.
How the examples were checked
Every worked example of the standard, and edge cases taken from the standard’s error rules and
from [MS-OI29500], were put in a flat ODS workbook of 96 formulas and converted to CSV by LibreOffice
(soffice --headless --convert-to csv; files
samples/xlsx/oracle/lookupfn/lookup-functions.fods and .csv in the project). The tables the standard prints
(HLOOKUP, INDEX, LOOKUP, VLOOKUP) are on a second sheet; the INDEX fruit table sits in E1:G7, not A1:C7 as
printed, so that the tables do not overlap, and the INDIRECT cells hold $d.AE2-style text
because LibreOffice’s own formula syntax has sheet names followed by a full stop (Excel’s is
Sheet1!A1). LibreOffice is an implementation, not the standard: where it differs from the
standard or from Excel’s notes the difference is reported, not corrected. Error values in the CSV
appear in LibreOffice’s own spellings: Err:502 (invalid argument), Err:504
(error in the parameter list), #REF!, #N/A, #NAME?.
Wildcards. The standard lets HLOOKUP, VLOOKUP and MATCH use ? and * in a text
lookup value (for MATCH only with match-type 0, for HLOOKUP and VLOOKUP only with range-lookup-flag
FALSE). In the flat ODS the wildcard cases (HLOOKUP("B*",...,FALSE),
MATCH("b*",...,0)) gave #N/A, because wildcards are a document setting that a flat ODS
leaves off. Opened from an XLSX they are on: a second oracle, an XLSX whose formula cells carry no cached
value (samples/xlsx/oracle/wildcardfn/wildcard-functions.xlsx, made by make-wildcard-xlsx.mjs), gave
MATCH("b*",A1:A4,0) = 2, MATCH("ch?rry",A1:A4,0) = 3,
MATCH("a~*b",A1:A4,0) = 4 (~ makes the next character literal),
VLOOKUP("b*",A1:B4,2,FALSE) = 2 and HLOOKUP("b*",D1:G2,2,FALSE) = 20. With
match-type 1 and with range-lookup-flag TRUE the same workbook also gave 2 for "b*"
(the standard allows wildcards only with 0 and FALSE; this is LibreOffice’s behaviour, recorded, not
relied on).
Not run. GETPIVOTDATA needs a pivot table and LibreOffice’s own GETPIVOTDATA has a different argument order, so it has no oracle row. RTD returned #NAME? in LibreOffice (no such function under that name), so its example has no result either.
ADDRESS (18.17.7.6)
ADDRESS ( row-number , col-number [ , [ ref-type ] [ , [ A1-ref-style-flag ] [ , sheet-name ] ] ] ):
creates a cell address, as text, from a row and a column number.
| Argument | Type | Meaning |
|---|---|---|
row-number | number | The number of the row. |
col-number | number | The number of the column. |
ref-type | number | 1 or omitted: absolute row and column; 2: absolute row, relative column; 3: relative row, absolute column; 4: relative row and column. |
A1-ref-style-flag | logical | TRUE or omitted: A1-style reference (18.17.2.3.1); otherwise R1C1-style (18.17.2.3.2). |
sheet-name | text | The worksheet name to put before the address. If omitted, no sheet name is used. |
Returns text. The standard: if row-number or col-number is below 1, or ref-type is outside 1–4, #NUM! is returned. Excel note (MS-OI29500 2.1.877): Office returns #VALUE! in those cases.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
ADDRESS(5,7,1) | $G$5 | $G$5 |
ADDRESS(5,7,2) | G$5 | G$5 |
ADDRESS(5,7,3) | $G5 | $G5 |
ADDRESS(5,7,4) | G5 | G5 |
ADDRESS(5,7,,,"Sheet1") | Sheet1!$G$5 | Sheet1.$G$5 (LibreOffice’s own sheet separator) |
ADDRESS(5,7,1,FALSE) | R5C7 | R5C7 |
ADDRESS(5,7,2,FALSE) | R5C[7] | R5C[7] |
ADDRESS(5,7,3,FALSE) | R[5]C7 | R[5]C7 |
ADDRESS(5,7,4,FALSE) | R[5]C[7] | R[5]C[7] |
Edge: ADDRESS(0,7) | #NUM! (Office: #VALUE!) | Err:502 |
Edge: ADDRESS(5,7,5) | #NUM! (Office: #VALUE!) | $G$5 (an out-of-range type is taken as 1) |
AREAS (18.17.7.10)
AREAS ( reference ): the number of areas (18.17.2.3) in a reference.
| Argument | Type | Meaning |
|---|---|---|
reference | reference | A reference to a single cell or a range of cells that can refer to multiple areas. |
Returns a number. The standard: if the reference designates no areas, #NUM!. Excel note (MS-OI29500 2.1.880): Office returns #NULL! if the reference designates no areas.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
AREAS(E312) | 1 | 1 (tried on a cell of the data sheet) |
AREAS(E311:F313) | 1 | 1 |
AREAS((E312:F314,G316:H316,G311)) (union) | 3 | 3 |
AREAS((E312:F314 E313:F314 F312:F314)) (intersection) | 1 | 1 |
CHOOSE (18.17.7.39)
CHOOSE ( index , argument-list ): selects the argument of argument-list at position index.
| Argument | Type | Meaning |
|---|---|---|
index | number | Truncated to an integer; shall be in 1 to n, where n is the number of arguments in argument-list. If index is an array, every element is evaluated, and in an array formula the result is an array of chosen values. |
argument-list | any | The arguments need not have the same type. |
Returns any type, including an array. If index is not an index into argument-list, #VALUE!. [MS-OI29500] has no note on CHOOSE.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
CHOOSE(E7,F7,G7,H7,I7,J7,K7,L7), E7 = 2, F7:L7 the weekday names Sunday to Saturday | Monday | Monday |
SUM(CHOOSE(E1,F20:G20,H20:J24)) | the sum of whichever area index selects | with index 1 and 2 on two areas of the data sheet: 19 and 66, the sums of the area chosen |
B9:B11 = 1, 3, 3 and CHOOSE(B9:B11,10,20,30) as a 3-cell array formula | 10, 30, 30 | 70 as the sum of the array (SUMPRODUCT(CHOOSE({1;3;3},10,20,30))), which is 10 + 30 + 30 |
Edge: CHOOSE(0,"a","b","c") | #VALUE! | Err:502 |
Edge: CHOOSE(4,"a","b","c") | #VALUE! | Err:502 |
Edge: CHOOSE(2.9,"a","b","c") | b (index truncated) | b |
COLUMN (18.17.7.42) and COLUMNS (18.17.7.43)
COLUMN ( [ reference ] ): the column number(s) of reference, which is a reference to a single
cell or to a range of contiguous cells. If omitted, it is as if reference were the cell holding the formula.
Returns a number for a single cell or a single column, and a horizontal array of the column numbers for a
range of several columns. If the range is not contiguous, #REF!.
COLUMNS ( array ): the number of columns in an array or reference. If the cells referred to
are not contiguous, #NULL!. [MS-OI29500] has no note on either function.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
COLUMN() in a cell of column 4 | 4 | 1 (formula in column A, so the column of the formula) |
COLUMN(E17:E19) | 5 | 5 |
COLUMN(E16:F17) | a horizontal array 5, 6 | 11 as the sum of the array (SUMPRODUCT), 5 + 6 |
COLUMNS(E16:F16) | 2 | 2 |
COLUMNS(E16:G18) | 3 | 3 |
COLUMNS({1,2;3,4}) | 2 | 2 |
ROW (18.17.7.281) and ROWS (18.17.7.282)
ROW ( [ reference ] ): the row number(s) of reference; if omitted, the row of the cell holding
the formula. A single cell or a single row gives a number; a range of several rows gives a vertical array.
A non-contiguous range gives #REF!.
ROWS ( array ): the number of rows in an array or reference. A non-contiguous range gives
#NULL!. Excel note (MS-OI29500 2.1.1035): Office returns #REF! if the array refers to a union
of discontiguous ranges. [MS-OI29500] has no note on ROW.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
ROW() in row 16 | 16 | 29 (the formula was in row 29 of the oracle sheet, so the row of the formula) |
ROW(E17:G17) | 17 | 17 |
ROW(E16:G17) | a vertical array 16, 17 | 33 as the sum of the array, 16 + 17 (a column of two, not six values) |
ROWS(E16:H16) | 1 | 1 |
ROWS(E16:G18) | 3 | 3 |
ROWS({1,2;3,4}) | 2 | 2 |
GETPIVOTDATA (18.17.7.137)
GETPIVOTDATA ( data-field , pivot-table , field-1 , item-1 [ , field-2 , item-2 [ , … ] ] ):
retrieves data stored in a pivot table report (calculated fields or items and custom calculations are
included).
| Argument | Type | Meaning |
|---|---|---|
data-field | text | The name of the data field that holds the data to retrieve. |
pivot-table | reference to any cell, range or named range in a pivot table report | Identifies the pivot table. If the range includes two or more pivot table reports, the data comes from whichever was created most recently in the range. |
field-1 … field-n, item-1 … item-n | text | Pairs of field and item names, in any order, that describe the data to retrieve. Names are in quotation marks, except dates and times (numbers) and numbers. For OLAP pivot tables an item can carry the source name of the dimension and of the item, for example "[Product]","[Product].[All Products].[Foods].[Baked Goods]". If the pairs describe a single cell, that cell’s value is returned whatever it is. |
Returns any type. If pivot-table is not a range in which a pivot table report is found, or the arguments do not describe a visible field, the return value is unspecified. The standard gives no example. Excel note (MS-OI29500 2.1.959): Office treats field-1 and item-1 as optional. How the pivot tables themselves are stored is on the Pivot tables page.
HLOOKUP (18.17.7.143) and VLOOKUP (18.17.7.343)
HLOOKUP ( lookup-value , table-array , row-index-num [ , [ range-lookup-flag ] ] ): searches
the top row of a table for a value and returns the value from the same column, in row
row-index-num. VLOOKUP ( lookup-value , table-array , col-index-num [ , [ range-lookup-flag ] ] )
is the same with rows and columns exchanged: it searches the left-most column and returns the value from
column col-index-num of the matching row.
| Argument | Type | Meaning |
|---|---|---|
lookup-value | value of any type, or a reference to one | The value to find. If range-lookup-flag is FALSE and lookup-value is a string, ? matches any single character, * matches any sequence of characters, and a tilde before either one matches that character itself. |
table-array | array, reference, name | The table. The first row (HLOOKUP) or left-most column (VLOOKUP) holds text, numbers or logical values. If range-lookup-flag is TRUE they shall be in ascending order: …, -2, -1, 0, 1, 2, …, A–Z, FALSE, TRUE. If FALSE they need not be sorted. Upper and lower case are equivalent. |
row-index-num / col-index-num | number | The row (HLOOKUP) or column (VLOOKUP) of table-array to return a value from; 1 is the first. |
range-lookup-flag | logical | TRUE or omitted: an approximate match; if there is no exact match, the largest value below lookup-value is used (the standard words this as “the next largest value that is less than lookup-value”). FALSE: an exact match. For VLOOKUP with FALSE, if several left-most values match, the top-most is used. |
Returns any type. Errors in the standard: no match on an exact search: #N/A; index below 1: #VALUE!; index greater than the number of rows (HLOOKUP) or columns (VLOOKUP): #REF!; lookup-value smaller than the smallest value in the first row or column: #N/A. Excel notes: HLOOKUP (MS-OI29500 2.1.961): the row index is truncated to an integer. VLOOKUP (2.1.1067): the left-most column has to be in ascending order only if range-lookup-flag is TRUE or omitted.
Slips in the standard. The VLOOKUP description of range-lookup-flag says “whether HLOOKUP is to find an exact or approximate match”, and its Return Type and Value says the column is found by searching “the top row”; both are HLOOKUP wording copied into VLOOKUP, and this page reads them as VLOOKUP.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
HLOOKUP("Axles",A1:C4,2,TRUE) (Axles, Bearings, Bolts over 4 6 9 / 5 7 10 / 6 8 11) | 4 | 4 |
HLOOKUP("Bearings",A1:C4,3,FALSE) | 7 | 7 |
HLOOKUP("B",A1:C4,3,TRUE) | 5 | 5 |
HLOOKUP("Bolts",A1:C4,4) | 11 | 11 |
HLOOKUP(3,{1,2,3;"a","b","c";"d","e","f"},2,TRUE) | c | c |
Edge: HLOOKUP("Bearings",A1:C4,2.9,FALSE) | Office truncates the index: 6 | 6 |
| Edge: row index 0 | #VALUE! | Err:502 |
| Edge: row index 5 of a 4-row table | #REF! | Err:502 |
Edge: HLOOKUP("Zed",A1:C4,2,FALSE) | #N/A | #N/A |
Edge: HLOOKUP("A",A1:C4,2,TRUE) (smaller than every value) | #N/A | #N/A |
Edge: HLOOKUP("B*",A1:C4,2,FALSE) | a wildcard match: 6 | #N/A (wildcards off in the flat ODS, see above) |
VLOOKUP(1,A2:C10,2) (density table 0.457 to 1.29, bearings 3.55 to 1.71, bolts 500 to 0) | 2.17 | 2.17 |
VLOOKUP(1,A2:C10,3,TRUE) | 100.00 | 100 |
VLOOKUP(2,A2:C10,2,TRUE) | 1.71 | 1.71 |
Edge: VLOOKUP(0.1,A2:C10,2) | #N/A (below the smallest) | #N/A |
| Edge: column index 4 of 3 columns | #REF! | Err:502 |
| Edge: column index 0 | #VALUE! | Err:502 |
Edge: VLOOKUP(0.616,A2:C10,2,FALSE) | 2.93 | 2.93 |
Edge: VLOOKUP(0.5,A2:C10,2,FALSE) | #N/A | #N/A |
Edge: VLOOKUP(1,A2:C10,2.9) | not stated for VLOOKUP (HLOOKUP truncates) | 2.17 (truncated to 2) |
Divergence. For an index of 0 or past the table, where the standard says #VALUE! or #REF!, LibreOffice gives Err:502 in both. The result in Excel was not run; [MS-OI29500] has no note on these cases.
HYPERLINK (18.17.7.145)
HYPERLINK ( link-location [ , [ friendly-name ] ] ): a shortcut that opens a document stored on
a network server, an intranet or the Internet when the cell is clicked.
| Argument | Type | Meaning |
|---|---|---|
link-location | text | The location to open: a place in a document (a cell or named range of a workbook, a bookmark in a WordprocessingML document), a path on a local drive or server, or a URL (the preferred form). Text or a reference to a cell holding text. If the location does not exist or cannot be navigated, an unspecified error occurs when the cell is clicked. |
friendly-name | text, number, name | The value shown in the cell; if omitted, link-location is shown. A value, string, name or a cell with the jump text. If it evaluates to an error value, the cell shows that error. |
Returns text: friendly-name if given, otherwise link-location. [MS-OI29500] has no note on HYPERLINK.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
HYPERLINK("http://example.openxmlformats.org/report/budget report.xls","Click for report") | shows Click for report | Click for report |
HYPERLINK("D:\FINANCE\1stqtr.xls",H10), H10 = 7 here | shows the number in H10 | 7 |
Edge: HYPERLINK("http://example.org/") | shows the link location | http://example.org/ |
The hyperlinks stored in a sheet’s own hyperlinks element, which need no function, are on
the Sheet features page.
INDEX (18.17.7.166)
Array form: INDEX ( array , [ row-number ] [ , [ column-number ] ] ). Reference form:
INDEX ( reference [ , [ row-number ] [ , [ column-number ] [ , [ area-number ] ] ] ] ). Locates a
value, or the reference to a value, within a table or range.
| Argument | Type | Meaning |
|---|---|---|
array | array, reference | The table or range. If it has one row, row-number is optional; if one column, column-number is optional. |
reference | reference | One or more ranges. If each area (18.17.2.3) has one row, row-number is optional; if each has one column, column-number is optional. |
row-number, column-number | number | The row and column to return from. If row-number is omitted, column-number shall be present, and the reverse. With both, the cell at the intersection. With only one of them on a table of several rows and columns, the whole row or column as an array. If one of them is 0, the array of values for the entire column or row. In the reference form, if both are omitted, the area given by area-number. |
area-number | number | Which range of reference to use; the first is 1, the second 2. If omitted, 1. For (A1:B4, D1:E4, G1:H4), area 2 is D1:E4. |
Returns various: the array form a value, a row or a column; the reference form a reference, a row or a column. Array form: a row-number or column-number outside the array gives #REF!. Reference form: a row-number, column-number or area-number outside the reference gives #REF!. Excel note (MS-OI29500 2.1.973): Office treats row-number as the column number if the array has only one row.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
INDEX({"Apples","Lemons";"Bananas","Pears"},2,2) | Pears | Pears |
INDEX({"Apples","Lemons";"Bananas","Pears"},2,1) | Bananas | Bananas |
INDEX({"Apples","Lemons"},,2) | Lemons | Lemons |
INDEX({"Apples";"Bananas"},1) | Apples | Apples |
INDEX(A2:C7,2,3) (fruit, price, count) | 38 | 38 |
INDEX((A2:C4,A6:C7),2,2,2) | 2.8 | 2.8 |
INDEX((A2:C4,A6:C7),2,2,1) | 0.34 | 0.34 |
Edge: SUM(INDEX(B2:C7,0,1)) (column 0 row gives a whole column) | the sum of the price column | 5.22 |
| Edge: row 7 of a 6-row table, column 4 of 3, area 3 of 2 | #REF! for each | #REF! for each |
Edge: INDEX({10,20,30},2) (one row, row-number only) | by the standard the row is 2, which is outside: #REF!; by Office the column: 20 | 20 |
INDIRECT (18.17.7.167)
INDIRECT ( ref-text [ , [ A1-ref-style-flag ] ] ): the value at the reference that ref-text
spells out, so that a reference can be changed without changing the formula.
| Argument | Type | Meaning |
|---|---|---|
ref-text | an A1-style reference, an R1C1-style reference, a name defined as a reference, or a reference to a cell holding one as a string | If it refers to another workbook, that workbook shall be open. |
A1-ref-style-flag | logical | TRUE or omitted: ref-text is A1-style (18.17.2.3.1); otherwise R1C1-style (18.17.2.3.2). |
Returns any type. If ref-text is not a cell reference, #REF!. If it names another workbook that is not open, the result is unspecified. If it is a name, the content of the named expression can have implementation-defined constraints. Excel notes (MS-OI29500 2.1.974): (a) Office returns #VALUE! if ref-text is longer than 255 characters (the standard sets no limit); (b) besides the forms the standard lists, Office accepts a structure (table) reference.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
INDIRECT($A$2), A2 holds a reference to B2 (value 1.333) | 1.333 | 1.333 |
INDIRECT($A$3), A3 refers to B3 (45) | 45 | 45 |
INDIRECT($A$4), A4 holds the defined name George, which refers to B4 | 10 | 10 (a named range in the flat ODS) |
INDIRECT("B"&$A$5), A5 holds 5, B5 = 62 | 62 | 62 |
INDIRECT("R[-1]C",FALSE) | the cell in the previous row and current column | the cell above: 62 (the formula in the row above gave 62) |
Edge: INDIRECT("not a reference") | #REF! | #REF! |
Edge: a 300-character ref-text | no limit; Office: #VALUE! | #REF! (not a valid reference) |
LOOKUP (18.17.7.202)
Vector form: LOOKUP ( lookup-value , lookup-vector , result-vector ). Array form:
LOOKUP ( lookup-value , array ). The vector form searches a one-row or one-column range and
returns the value at the same position of a second vector; the array form searches the first row or column of
an array and returns the value at the same position of its last row or column.
| Argument | Type | Meaning |
|---|---|---|
lookup-value | number, string, logical, name, reference | The value to search for. |
lookup-vector | reference | A range of one row or column. Its text, numbers or logical values shall be in ascending order (…, -2, -1, 0, 1, 2, …, A–Z, FALSE, TRUE); case is ignored. If the value is not found, the largest value less than or equal to lookup-value is matched. |
result-vector | reference | A range of one row or column, the same size as lookup-vector. |
array | text, number, logical | Cells compared with lookup-value, in ascending order as above. If the array has more columns than rows, the first row is searched; if square or taller than wide, the first column. |
Returns any type. Unspecified in the standard: lookup-value smaller than the smallest value, result-vector of a different size, values not in ascending order. [MS-OI29500] has no note on LOOKUP.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
LOOKUP(4.19,A2:A6,B2:B6) (frequencies 4.14, 4.19, 5.17, 5.77, 6.39 with colours red, orange, yellow, green, blue) | orange | orange |
LOOKUP(5,A2:A6,B2:B6) | orange | orange |
LOOKUP(7.66,A2:A6,B2:B6) | blue | blue |
LOOKUP("C",{"a","b","c","d";1,2,3,4}) | 3 | 3 |
LOOKUP("bump",{"a",1;"b",2;"c",3}) | 2 | 2 |
Edge: LOOKUP(1,A2:A6,B2:B6) (smaller than the smallest) | unspecified | #N/A |
MATCH (18.17.7.204)
MATCH ( lookup-value , lookup-array [ , [ match-type ] ] ): the relative position of an item that
matches a value, in a given order. It does not distinguish upper and lower case in strings.
| Argument | Type | Meaning |
|---|---|---|
lookup-value | number, string, logical, name, reference | The value to search for. If match-type is 0 and it is a string, ? and * are wildcards (a tilde before them matches the character). |
lookup-array | array, reference | A contiguous range of possible values. |
match-type | number | -1: the smallest value greater than or equal to lookup-value; the array shall be in descending order (TRUE, FALSE, Z–A, …, 2, 1, 0, -1, -2, …). 0: the first value exactly equal; any order. 1 or omitted: the largest value less than or equal; ascending order. |
Returns a number. No match: #N/A. A match-type out of bounds: #NUM!. Excel notes (MS-OI29500 2.1.990): (a) Office returns #N/A, not the standard’s #NUM!, when no match is found (a conflict inside the standard: it says #N/A in the clause’s own text and #NUM! only in the note, so the note adds nothing here beyond confirming #N/A); (b) in Office lookup-array has to be an array or range with one row or one column, else #N/A.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
MATCH(39,{25,38,40,41},1) | 2 | 2 |
MATCH(41,{25,38,40,41},0) | 4 | 4 |
Edge: MATCH(7,{25,38,40,41},0) | #N/A | #N/A |
Edge: MATCH(39,{25,38,40,41},2) | #NUM! | Err:504 |
Edge: MATCH(40,{41,40,38,25},-1) | 2 | 2 |
Edge: MATCH("b*",{"abc","bcd"},0) | 2 (wildcard) | #N/A (wildcards off in the flat ODS) |
Edge: MATCH(1,A1:B2,0) (two-dimensional range) | Office: #N/A | Err:504 |
OFFSET (18.17.7.245)
OFFSET ( reference , rows , cols [ , [ height ] [ , [ width ] ] ] ): a reference to a range that is
a given number of rows and columns away from a cell or range, of a given size.
| Argument | Type | Meaning |
|---|---|---|
reference | reference | The base: a cell or a range of adjacent cells. |
rows | number | Rows to move to the upper-left cell of the result; positive is below, negative above. |
cols | number | Columns to move to the upper-left cell of the result; positive is to the right, negative to the left. |
height | number | Rows in the result; shall be positive. If omitted, the height of reference. |
width | number | Columns in the result; shall be positive. If omitted, the width of reference. |
Returns a reference. If reference is not a cell or range of adjacent cells, #VALUE!; if rows and cols put the result outside the worksheet, #REF!. Excel note (MS-OI29500 2.1.1012): Office allows negative height and width.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
OFFSET(C3,2,3,1,1) | the value in F5 | 0.25 (the value in F5 of the data sheet) |
SUM(OFFSET(C3:E5,-1,0,3,3)) | the sum of C2:E4 | 30 (the C2:E4 of the data sheet) |
Edge: OFFSET(C3,0,0,-1,1) | shall be positive; Office allows it | Err:502 |
Edge: OFFSET(A1,-1,0) (above row 1) | #REF! | Err:502 |
RTD (18.17.7.284)
RTD ( progID , [ rtd-server ] , argument-list ): retrieves data from a program in real time. The
function returns new values periodically and causes the expression containing it to be recalculated.
| Argument | Type | Meaning |
|---|---|---|
progID | text | The name of the program that supplies the data. |
rtd-server | text | Optional string specific to the program. |
argument-list | any | The presence and meaning of each argument is specific to the program. |
Returns an array: the values the program returns. Excel notes (MS-OI29500 2.1.1036): (a)
if progID does not name a registered application that implements IRTDServer, #N/A; (b) the application has
to implement the IRTDServer interface; (c) argument-list is required but may be left blank. The standard’s
example is a stock-price program, RTD("stockprice.rtd","NASD","MSFT"), whose result changes every
few seconds, and RTD("stockprice.rtd","NASD","MSFT","GOOG","AMZN"), a server written to take
several arguments. LibreOffice gave #NAME? for the call (no RTD function), so there is no oracle value.
How a workbook stores the real-time data topics is in the Cube and RTD part of the
Data, links and revisions page.
TRANSPOSE (18.17.7.327)
TRANSPOSE ( array ): a new array whose first column is the first row of array, and so on. The
formula shall be an array formula over a range with as many rows and columns as array has columns and
rows. Argument: array, array or reference, the values to transpose. Returns an array.
[MS-OI29500] has no note on TRANSPOSE.
| Standard’s example | Standard says | LibreOffice |
|---|---|---|
TRANSPOSE({10,20,30}) | the array {10;20;30} | 3 rows (ROWS of the result), and its third element is 30 |
What the viewer does
The viewer shows the value a cell stores and never recalculates a worksheet; its conditional-format rules
(explorer/formats/xlsx/cf.js) calculate a small set of functions. Of this page’s functions
only ROW and COLUMN are in that set: with no argument they give the row or column of the cell the rule is
tested on, with a reference the first row or column of it (where the standard gives an array for a range).
The result is compared with the oracle (rows 23 and 30) in test-xlsx-built.mjs. Every other
function on this page makes a rule “not calculated”: the viewer then does not apply the rule and says
so in the rules panel. Two fixes were made while writing this page: ROW and COLUMN with a single cell
(ROW(B7)) were not calculated, and a range written A1:A3 inside a function call
(SUM, COUNTIF, ROW and the others) was not read as a range at all.
See also
- Formulas: references, ranges, unions, intersections, defined names
- Functions: math
- Functions: text
- Functions: date and time
- Pivot tables: what GETPIVOTDATA reads
Not described on this page
- Excel’s own results for the examples: only [MS-OI29500] was read; Excel was not run, so the last column is LibreOffice, not Excel.
- GETPIVOTDATA and RTD results: no oracle value (see above); the standard gives no GETPIVOTDATA example.
- The other categories of 18.17.7 (information is on its own page): engineering, statistical, financial, database, cube and the math functions outside the math page. Functions that Excel added after the standard (XLOOKUP, FILTER and the like) are not in Part 1 or in the [MS-OI29500] notes searched, and are not described here.
Sources
- ECMA-376 5th edition Part 1, research/ooxml/ecma376/p1/part1.txt: category table (line 77030), 18.17.7.6 ADDRESS (line 77367), .10 AREAS (77661), .39 CHOOSE (78754), .42 COLUMN (78813), .43 COLUMNS (78834), .137 GETPIVOTDATA (82505), .143 HLOOKUP (82771), .145 HYPERLINK (82860), .166 INDEX (83438), .167 INDIRECT (83520), .202 LOOKUP (84521), .204 MATCH (84600), .245 OFFSET (86416), .281 ROW (87803), .282 ROWS (87827), .284 RTD (87902), .327 TRANSPOSE (89140), .343 VLOOKUP (89585)
- [MS-OI29500] v20260818, research/ooxml/ms/MS-OI29500.txt, notes 2.1.877 (line 17916), 2.1.880 (18008), 2.1.959 (19015), 2.1.961 (19021), 2.1.973 and 2.1.974 (19091 to 19101), 2.1.990 (19296), 2.1.1012 (19667), 2.1.1035 and 2.1.1036 (19972 to 19983), 2.1.1067 (20185)
- LibreOffice, soffice headless, flat ODS to CSV: samples/xlsx/oracle/lookupfn/