
Larry C. answered 03/21/19
Computer Science and Mathematics professional
The general format is the following:
=VLOOKUP(lookup value, range containing the lookup value, the column number in the range containing the return value, optionally specify TRUE for approximate match or FALSE for an exact match).
What that means is this:
lookup value: the actual value or a cell reference of the value that you're looking for. This value ideally should be unique within the search block. (While there are workarounds if there are duplicates, it's a bit too complicated to go into here. A Google search should find you a number of possible ways.)
range: the rectangular block of cells that you want to search in the usual upper left:lower right format. The first column of the searched block must be the one that contains the value searched for
column number: the number of the column containing the value that will be the result of the search. This is the number relative to the column containing the search value NOT that of the entire spreadsheet
optional TRUE/FALSE: whether an approximate match is acceptable. Note that TRUE is the default. If an exact match is not found and FALSE is specified, the return value is #N/A. If TRUE is specified and no exact value is found, the next lowest value that can be found is selected.
For example, if the sheet contained the following:
A/B/C/D
Emp#/Last/First/Job Title
101/Doe/John/Sales Manager
102/Smith/Fred/Sales Rep
108/Brown/Joe/Sales Rep
=VLOOKUP(102, A2:D4, 2, FALSE) would return Smith
=VLOOKUP("Doe", B2:D4, 3, FALSE) would return Sales Rep (note that it returns the value from the third column relative to the searched column.)
=VLOOKUP(105, A2:D4, 2, FALSE) would return #N/A
=VLOOKUP(105, A2:D4, 2) would return Smith