Skip to content

vlookup

Vertical lookup in a table.

v = vlookup(lookup_value, table_array, col_index_num, range_lookup)

Searches the first column of table_array for lookup_value and returns the value from column col_index_num of the same row. With range_lookup = true (default), uses approximate match (table must be sorted ascending); with false, exact match.

For more flexible lookups including searching from the right or returning a default for not-found, use xlookup.

vlookup('apple', T, 2, false)
  • hlookup — Horizontal lookup in a table.
  • xlookup — Modern lookup with optional default and search direction.
  • lookup — Approximate-match lookup in a vector or array.
  • match — Position of a value in a vector.
  • index — Element of an array by row and column position.