If the name is not found, display a message indicating so. Your task is to pull a number corresponding to the name the user enters in F1. Supposing, you have a list of seller names in one column and sales amounts in another column.
Naturally, you can type any text you like instead of "Not found". IF(ISNA(VLOOKUP(…)), "Not found", VLOOKUP(…)) To catch that error and replace it with your own text, embed a Vlookup formula in the logical test of the IF function, like this: If the VLOOKUP function cannot find a specified value, it throws an #N/A error. Where A2:A10 are seller names and C2:C10 are sales. Taking our example further, let's calculate the commission of a specific seller (F1) depending on their effectiveness: 20% commission for those who made $200 and more, 10% for everyone else.įor this, you check if the value returned by Vlookup is greater than or equal to 200, and if it is, multiply it by 20%, otherwise by 10%: =IF(ISNA(VLOOKUP(A2,$D$2:$D$4,1,FALSE)),"Yes","No")Įxcel If Vlookup formula to perform different calculationsīesides displaying your own text messages, If function with Vlookup can perform different calculations based on the criteria you specify. If your business logic requires the opposite results, simply swap "Yes" and "No" to reverse the formula's logic: If the match is found, "Yes" is returned. If Vlookup results in the #N/A error, the formula returns "No", meaning the lookup value is not found in the lookup list. To compare each cell in the target column with another list and return True or Yes if a match is found, False or No otherwise, use this generic IF ISNA VLOOKUP formula: In a similar fashion, you can use any other logical operator together with a cell reference in your Excel If Vlookup formula. =IF(VLOOKUP(E1,$A$2:$B$10,2)>=G2,"Yes!","No")Īnd here is our If formula with Vlookup in action: For example, we can check if it's greater than or equal to a number in cell G2: Compare Vlookup result with another cellĪnother typical example of Vlookup with If condition in Excel is comparing the Vlookup output with a value in another cell. In this case, be sure to enclose a text string in quotation marks, like this: You can also compare the value returned by Vlookup with sample text. Instead of Yes/No, you can return TRUE/FALSE or In Stock/Sold out or any other two choices. Then, write an IF statement that compares Vlookup's result with zero, and returns "No" if it is equal to 0, "Yes" otherwise: You pull the quantity with a regular Vlookup with exact match formula like this: You are creating a dashboard for your users and need a formula that would check the quantity for an item in E1 and inform the user whether the item is in stock or sold out. Let's say, you have a list of items in column A and quantity in column B.
Compare Vlookup result with a specific value If Vlookup is false (not equal to the specified value), the formula returns False.īelow you will a find a few real-life uses of this IF Vlookup formula. Translated in plain English, the formula instructs Excel to return True if Vlookup is true (i.e. In most cases, the following generic formula would work nicely: One of the most common scenarios when you combine If and Vlookup together is to compare the value returned by Vlookup with a sample value and return Yes / No or True / False as the result. Vlookup with If statement: return True/False, Yes/No, etc. IF INDEX MATCH - left vlookup with If condition.Excel Vlookup: if not found return blank.IFNA VLOOKUP to trap #N/A in Excel 2013 and higher.IF VLOOKUP formula to perform different calculations.IF formula with VLOOKUP: return True/False or Yes/No.This tutorial implies that you remember the syntax of the two functions well, otherwise you may want to brush up on your knowledge by following the above links. Whilst the VLOOKUP and IF functions are useful on their own, together they deliver even more valuable experiences.
#How to use vlookup in excel 2016 for different sheets how to#
You will also learn how to use IF ISNA VLOOKUP formulas to replace #N/A errors with your own text, zero or blank cell. The tutorial shows how to combine V LOOKUP and IF function together to v-lookup with if condition in Excel.