VLOOKUP is a function in Microsoft Excel that is used to look up and retrieve data from a table based on a specified criteria or search term.
The VLOOKUP function consists of four arguments:
- Lookup value: This is the value that you want to search for in the leftmost column of the table.
- Table array: This is the range of cells in which you want to search for the lookup value.
The leftmost column of the table array must contain the lookup value. - Column index number: This is the number of the column in the table array that contains the data you want to retrieve. Column index number 1 is the leftmost column in the table array, column index number 2 is the second column, and so on.
- Range lookup: This is an optional argument that specifies whether you want an exact match or an approximate match. If you set range lookup to TRUE (or leave it blank), Excel will look for an approximate match. If you set range lookup to FALSE, Excel will look for an exact match. By using the VLOOKUP function, you can easily retrieve data from a large table or database and incorporate it into your Excel worksheets.
For example: The requirement is to know the difference in rebate amount in a case when the rebates have not applied to invoices even if they have applied to sales orders. Then we need to create saved searches for sales orders and invoices to compare the rebate amounts. For comparing we can use VLOOKUP function.
Here are the steps you can follow to compare the rebate amounts for sales orders and invoices:
- Export both saved searches as Excel files.
- In a new Excel worksheet, copy and paste the columns for the rebate amounts from both the sales order and invoice files. Use the VLOOKUP function to compare the rebate amounts for each sales order with its corresponding invoice.
- To do this, set the lookup value to the sales order number in one table, and the table array to the invoice table, with the rebate amount column as the column index number.
If the rebate amount in the sales order does not match the rebate amount in the invoice, the VLOOKUP function will return an error or #N/A.
You can use the IFERROR function to display a custom message instead.
In this way we can identify the discrepancies in the rebate amounts.
This method allows you to easily compare large amounts of data and identify any differences in rebate amounts between sales orders and invoices.