Contact

VLOOKUP Function (Gnumeric)

Lookup Intermediate Gnumeric

Search vertical tables in Gnumeric with VLOOKUP, exact keys, ascending thresholds, relative column offsets and the optional index result.

Verification status: Fresh Gnumeric 1.12.57 source and bounded native engine checks; no GUI. How formula examples are checked

Exact syntax

=VLOOKUP(value,range,column[,approximate[,as_index]])

VLOOKUP searches the first column of a rectangular range and returns a value from another column of the matched row. Value, range and column are required. Column is a one-based offset within the selected range, not a worksheet column number. Approximate defaults to TRUE when omitted; set it explicitly to FALSE or 0 for an exact key search. Gnumeric also supports an optional fifth as_index argument, default FALSE.

The preserved product table and both exact examples below return the price from column 2. The lookup keys must occupy the range’s first column. A column offset cannot request a value to the left of that first column; restructure the table or use a more flexible lookup approach when that is required.

Approximate mode and thresholds

For a separate vertical table, put thresholds 0,10,20 in A1:A3 and labels low,medium,high in B1:B3. =VLOOKUP(15,A1:B3,2) returns “medium”. The omitted fourth argument selects approximate mode, requiring ascending thresholds and choosing the last key less than or equal to 15. =VLOOKUP(-1,A1:B3,2,TRUE()) returns #N/A because -1 is below the minimum.

This rule does not choose the numerically closest key. Unsorted threshold tables are unsafe for this mode even when an individual returned value looks reasonable. Use exact mode for identifiers unless a deliberate threshold model is intended.

Advanced application: inspect the row offset

=VLOOKUP("Pear",F1:G3,2,0,TRUE()) returns 1, the zero-based row offset of Pear. For the missing key “Missing”, the same as_index mode returns -1. The column argument remains a valid one-based range offset even when index mode is requested. Check -1 before converting or passing the returned offset to another function; a zero-based offset and a one-based row number are not interchangeable.

This fifth argument is a Gnumeric extension and should not be assumed portable. For a reusable exact-price worksheet with a key in A5, a typical formula is =VLOOKUP(A5,$F$1:$G$3,2,FALSE()); the absolute range prevents accidental movement when filling down. That cell-reference application is derived from the tested literal cases.

Errors and troubleshooting

An absent exact key returns #N/A in normal value mode. Column=3 on the two-column range gives #REF!, while column=0 gives #VALUE!. Prefer integer offsets, keep keys and return values aligned, and check imported key types or unwanted spaces before assuming the product is missing. Wildcard/pattern, duplicate-key and locale-dependent matching are outside these bounded equality tests.

Worked example

For a product lookup, enter the following into cells F1:G3:

F (Product) G (Price)
Apple 5
Pear 8
Plum 4
=VLOOKUP("Pear",F1:G3,2,0)

Expected result: 8.

Why it works: Look up a price using an exact match in the first column. The specified sample table supplies the referenced cells.

Another practical example

Practice inputs: F1:G3 has Apple/5, Pear/8, Plum/4 in rows 1–3.

=VLOOKUP("Apple",F1:G3,2,FALSE())

Expected result: 5.

An exact match in the first column finds Apple, then returns its price from column 2.

What to watch for

The lookup key must be in the first column of the specified range. FALSE selects an exact match.

For LibreOffice Calc formulas, separators are commonly semicolons; the Gnumeric examples here use commas. These exact worked examples are included in the fresh Gnumeric 1.12.57 native fixture.

Recorded native results

  • =VLOOKUP("Pear",F1:G3,2,0) → 8
  • =VLOOKUP("Apple",F1:G3,2,FALSE()) → 5
  • =VLOOKUP("Missing",F1:G3,2,0) → #N/A
  • =VLOOKUP("Pear",F1:G3,3,0) → #REF!
  • =VLOOKUP("Pear",F1:G3,0,0) → #VALUE!
  • =VLOOKUP(15,A1:B3,2) → medium
  • =VLOOKUP(-1,A1:B3,2,TRUE()) → #N/A
  • =VLOOKUP("Pear",F1:G3,2,0,TRUE()) → 1
  • =VLOOKUP("Missing",F1:G3,2,0,TRUE()) → -1

Availability, portability and verification

Official NEWS identifies VLOOKUP as implemented in Gnumeric 0.19. The last functioning release is not established. The retained historical check documented Gnumeric 1.12.62 registration on 14 October 2026, for desktop installations with the fn-lookup module included and enabled. This is separate from the fresh official 1.12.57 source inspection and bounded ssconvert execution on 17 October 2026. No execution of 1.12.62 is claimed.

Every saved input formula and output cell was independently read back; results match explicit code-point, table-lookup, Roman-notation or sorted-multiset expectations exactly. Source and native evidence hashes were verified. This is engine evidence, not GUI verification. The earlier comparable LibreOffice Calc 25.2 test is historical context; it does not establish identical coercion or extensions across programs. Check receiving applications and locales before transferring formulas.

First-party sources