What is VLOOKUP in Excel?
The VLOOKUP function in Excel is used when you need to find things in a table or a range by row. For example, you might need to look up a price using a part number, or find an employee name based on their employee code. In the following example we lookup the price of a regular Flat White!
In its simplest form, the VLOOKUP function says:
- What you want to look up or find in the first column of the table (my favourite coffee which happens to be a Flat White)
- Where you want to look for it (the table range excluding the headings in this example the range is our coffee menu A2:D7)
- The column number in the range containing the value to return (in this example I want to find the price for a regular Flat White, regular size is Column B which is column index number 2) NOTE the column has to be to the right of the lookup value
- Range lookup: This argument is optional but defaults to finding the closest match if left empty. In this example I want to find an exact match so I enter 0 (you can also enter FALSE).
- In short, search for Flat White in the first column of the table and return the price from the 2nd column.
In the above example, I used the Format as Table option to define the range for the lookup table, this is a great tool if you know that you'll be adding extra rows to the end of the table as it automatically expands to include new lines.
NOTE: It isn't necessary to sort the first column of the table if you're returning an exact match.
Watch this video below to see how it's done...
See you again soon, please comment and share if you found useful!