|
|
Excel Vlookup Tutorial Part 4 - Vlookup Example With Closest Match
If the [range_lookup] argument in the Vlookup function is set to TRUE (or is omitted), this tells the Vlookup function that if it is unable to find an exact match to the lookup_value, then the closest match below the lookup_value should be used instead. It is important to remember that, when the [range_lookup] argument is set to TRUE, the left-hand column of the table_array must be in ascending order. If it isn't, the results from the Vlookup function may be unpredictable. The following spreadsheet shows a Vlookup example with the [range_lookup] argument set to TRUE.
Imagine a bank account has a variable interest rate, that depends upon its balance as shown in the table on the right. The "Interest Rate" spreadsheet below shows these interest rate categories and the "Bank Accounts" spreadsheet below shows several bank accounts, along with their current balances.
Column C of the "Bank Accounts" spreadsheet is currently blank, but this column needs to be updated with the interest rate that is to be applied to each bank account, depending on the account's current balance. This can be done using the Vlookup function, as shown below:
For each of the bank accounts in the above spreadsheet, the Vlookup function, finds the closest value below the current balance, in column A of the "Interest Rates" spreadsheet. The function then returns the corresponding value from column C of this spreadsheet. The results of the Vlookup functions are shown below:
Vlookup Example ExplainedThe first call to the Vlookup function, in C2 is:
=VLOOKUP( B2, 'Interest Rates'!A2:C5, 3, TRUE )
The table below explains the arguments that are supplied to this function:
Further Vlookup examples are provided on the Microsoft Office website. |
||||||||||||||||||||||||||||
|
|
Copyright © 2008-2011 ExcelFunctions.net |