Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the function VLOOKUP to search for a specific target within a two-dimensional range and return the corresponding value in a specific column of the same row.

Here is the syntax of the VLOOKUP function:

=VLOOKUP(search_key, range, index, [is_sorted])
  • search_key is the value you want to search for.
  • range is the two-dimensional range in which you want to search for the value.
  • index is the column number (starting from 1) of the value you want to return in the same row where the search_key appears.
  • is_sorted (optional) is a boolean value that indicates whether the range is sorted in ascending order. If omitted, the default value is TRUE, which means the function assumes the range is sorted.

Here is an example of how to use the VLOOKUP function to select a value in a row when a specific target appears within a two-dimensional range:

Assume you have a two-dimensional range A1:B5 that contains a list of names and their corresponding ages. You want to find the age of a specific person whose name is "John". Here are the steps:

  1. Enter the following formula in a cell:
=VLOOKUP("John", A1:B5, 2, FALSE)
  1. Press Enter. The function will search for the value "John" in the first column of the range A1:B5 and return the corresponding value in the second column of the same row, which is John's age.

Note that if the search_key is not found in the range, the function will return an #N/A error.