I have taken the same example of retrieving the Salary for the designation of an employee, which we have seen in excel and open office vlookup demo.
You can just copy and paste the contents of Sheet1 and Sheet2 in your own Google Spreadsheet. You can use the below for reference:
Google Spreadsheet Vlookup Syntax
Below is the Google spreadsheet vlookup syntax
VLOOKUP (search_key, range, index, [is_sorted])
There are 3 mandatory parameters and 1 optional parameter required to complete the vlookup function.
- search_key – This is the value to search for. In our case we need to search for Designation.
- Range – The range is nothing but the set of columns that you specify against which the search_key will be looked up. The first column in the range should always have the search_key in order for the vlookup to work.
- Index – The column index in the range from which you would like to get a value. The index starts from 1.
- is_sorted – This is an optional parameter and you can provide FALSE just like you do in excel or open office.
Steps to perform Vlookup
Once you have the sample data in place just follow the below steps to complete the vlookup.
- STEP-1: In Sheet1, cell D2, press = (equal to) and type vlookup and hit the tab key.
- STEP-2: For the search_key parameter select cell C2 in Sheet1 itself and press comma to move to the next parameter.
- STEP-3: For the range parameter click on Sheet2 and select A1 till B7 and then press comma.
- STEP-4: For the index parameter, enter 2 since the Salary column is the second column in Sheet2 and press comma.
- STEP-5: As for the last parameter, enter FALSE.
Note: You cannot enter 0 instead of FALSE as you do it in Excel for the last parameter.
Finally to avoid cell references getting changed, go to range parameter in your vlookup function and press F4
Your final formula should look like as shown below:
That’s it you should now see the Salary populated for the Designation that are searching for. You can also take a look at the video demo below to understand how this being done.
Google Spreadsheet Vlookup Demo