IF VLOOKUP Formula in Excel (Table of Contents)
Introduction to VLOOKUP Formula in Excel
IF and Vlookup are the built-in functions used in excel. IF function performs a logical operation and results in a Boolean value. The vlookup function is used to perform some lookup action among the given data. when you need to find a particular data from an excel file or a range of cells this is the easy method.
Using Vlookup with IF function the Vlookup result will be compared with another value. And that may result in a “true/false” or “yes/ no”. By combining the “IF” function along with Vlookup you will get an exact comparison of the Vlookup result with any cell value.
After performing the logical operation, the final result will be a true section or false section of the IF function. Generally, the formula can be written as IF(VLOOKUP(…) = sample value, TRUE, FALSE).
- Lookup value – This refers to a cell value or a text that you are looking for
- Table_ array – Defines the range of cells or source where you want to look for the value.
- Col_index_number – Number of the column from which you want to return the value.
- Range_lookup – True or false to get the exact match or similar data.
How to Use IF VLOOKUP Formula in Excel?
IF VLOOKUP Formula in Excel is very simple and easy. Let’s understand how to use the IF VLOOKUP Formula in Excel with some examples.
Example #1 – Using the IF Function with Vlookup
Below is an example of using the “IF” function with Vlookup. The lookup value is compared with an integer value. Where the list of items and their quantity is given. From the given list need to find whether the specified product is in stock or not.
Select the Item and paste it in a cell for which we want to check whether the item is in stock or not.
Select the cell F2 where you want the get the final result and apply the formula IF VLOOKUP.
The function Vlookup is applied as VLOOKUP (E2, $B$2: $C$15,2, FALSE) to find the quantity of the item name given in F2.
And using “IF” this Vlookup result will be compared with “0”.
- If the quantity not equal to zero, then it will return “Yes” that is the stock is in hand. Else it will return “No” that means the stock is not in hand.
Here we have checked the item “tobacco_barn” is in stock or not. Since the Quantity is not zero it returned the value “yes”.
Example #2 – Compare the Vlookup Value with Another Cell Value
Let’s look at an example to compare the Vlookup value with another cell value.
Above given are the different products and their amount of sales that have done for a period. We need to find if there any maximum sales for a specified item.
Select the cell C2 and apply the formula, By using the MAX Formula.
The result value will be pasted to cell E2. And is the highest amount of sales done within the given data.
To check the product given in D2 is there any maximum sales occurred or not.
Select cell E2 and apply the formula.
The formula applied with a logical operation by referring a cell value in E2. For the product given in E2 is the maximum sales happened. So the result of the applied IF function is “Yes”.
- IF function will perform a logical operation with the Vlookup value and return a Boolean value.
- According to the result, the true section or false section will be returned as the final output.
- Instead of true or false you can mention any text in both sections.
Example #3 – IF Vlookup Formula to perform Multiple Calculations
Apart from displaying the text messages given this formula combination can be used to perform different calculations based on given criteria.
- IF Vlookup is used to perform different calculations according to the Vlookup condition.
- More than one Vlookup function can be associated with the IF function.
- Instead of using texts, the Vlookup function is performed in the true and false section.
It gives the products and the amount of sales done by different sellers. Here we need to find the commission for the seller specified in cell D2 according to the sales they have completed.
If the sales amount is greater than $50 then 20% commission will be provided else 10%. So these two conditions are specified in the given formula.
The IF function is performed on this result by applying a logical operation “>=50”.
If this condition satisfies then the true section of the IF function will be performed that is VLOOKUP (D2, A2: C15,3) *20% it returns the 20% of the sales done for the specified person.
When the IF condition does not satisfy VLOOKUP (D2, A2: C15,3) *10% this formula will be executed. And it will return 10% of the sales amount.
Here the first condition satisfies and returns 20% of the sales value of the specified person.
So the 20% of the sales amount done by salesperson Alwin will be returned as the final output that is 10.
Things to Remember About IF VLOOKUP Formula in Excel
- Should be careful about selecting the range where you want to apply the IF(Vlookup(..)) function.
- To avoid mismatches while copying the formula use $ symbol along with the range value.
- IF with Vlookup function is used when you want to take any decision based on the result.
- Along with IF function any text message can be given in true and false section.
This is a guide to IF VLOOKUP Formula in Excel. Here we discuss How to use IF VLOOKUP Formula in Excel along with practical examples and downloadable excel template. You can also go through our other suggested articles –