Ask Your Question
3

In Google Sheets, how can I select a value in a row when a specific target appears within a two-dimensional range?

asked 2021-06-17 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-09-03 03:00:00 +0000

djk gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-06-17 11:00:00 +0000

Seen: 9 times

Last updated: Sep 03 '22