Can it be possible….? Friends, just go through the following case and tell me is there any possibility available to solve the issue with the help of VLOOKUP function.
A dealer wants to give a festival offer to his customers. He announces the following discounts.
| Units | Product A | Product B | Product C |
| Upto 499 | 0% | 5% | 0% |
| >=500 | 0% | 15% | 5% |
| >=1000 | 10% | 25% | 10% |
| Price (Rs.) | 10.00 | 8.00 | 25.00 |
Pick the appropriate discount rates for the following cases with the help of VLOOKUP function:
- Z orders 100 units of product B
- X orders 600 units of Product C.
- Y orders 2500 units of product A.
Without looking at the solution try these cases... if you are unable to find the solution then read further.
VLOOKUP Function
Recall the syntax of VLOOKUP function. i.e., =vlookup(Lookup_value,table_array,col_index,range_lookup)
Here, we are giving FOUR Input parameters. Let us concentrate only on the fourth parameter now to solve this case.
Range_lookup
While using Vlookup function, we are used to assign FALSE (0) as Range_Lookup. What will be the result if I assign TRUE (1) as Range_Lookup?
- FALSE (0) as Range_Lookup: VLOOKUP will find the exact match, and if it is not found, it will return an error value (#N/A).
- TRUE (1) as Range_Lookup: This function will return the exact match, and if the same is unavailable, it will return the approximate match. In other words, if VLOOKUP can't find lookup_value, it uses the largest value that is less than or equal to lookup_value.
To solve the above said cases we have to use TRUE (1) as Range_lookup.
To illustrate, I am going to take the 3rd case - Y orders 2500 units of product A. (to explain the first 2 cases, we need some assistance from other function to get the result. We can get the result for the first 2 cases with the help of combined functions only.)
CASE 3:
Syntax is =vlookup(2500,A1:B4,2,1)
The function will return 10% as result as “2500” will not exactly match with the database. So, the function will look for the next highest value that is less than
2500.
To check this formula, you can try with some other units (say 499 units, 950 units or with exact values 0, 500 and 1000)
OTHER CASES
In the previous case, we have used 2 as column index to find the discount rate for 2500 units of Product A. we know that the details of Product A are available under column 2. How can we assist the system to find the column index automatically instead of feeding the column index manually?
MATCH Function
This function will return the relative position of an item from the selected area (i.e row or column)
Syntax: =match(lookup_value,lookup_array,match_type)
Let us now find the Column index of Product B
=match(“Product B”,A1:D1,0)
The function will return 3 as result.
COMBINED FUNCTION
Now we are going to solve the first 2 cases. For that we have to combine VLOOKUP function and MATCH function to get the desired result.
CASE 1:
Here we have two inputs i.e ITEM and ORDER QTY. First, we need to find the discount rate for Product B when the ordering quantity is 100 units.
Instead of giving column index manually, here we have inserted MATCH function to get the column index. (To test this function, change the item name as Product A or Product C)
Now, Try the rest (You already know how to use) to get the net value of the ordered quantity.
REMEMBER
- To get the accurate result from the VLOOKUP function, lookup_values (i.e. in this example “Units” column) should be in ascending order.
- If it is not so, the function may not find the largest value that is lower than the lookup value.





Very nice Kamaraj...
ReplyDeleteKeep it up :)