How to Use VLOOKUP for Approximate or Exact Matches in Excel

This post will guide you how to use VLOOKUP function to look up values based on an exact or approximate match in Excel 2013/2016 or the higher versions. VLOOKUP function can search a range of cells for a specific value or data and if a match is found, and it will return a piece of data from that matching.

In most of cases, you can be use VLOOKUP function to find exact matches from a given range of cells based on some kind of value in your worksheet. Also you can also use VLOOKUP function to find non-exact or approximate matches to achieve your request.

If you still do not know what is exact or approximate matches in VLOOKUP function in Microsoft Excel, and it is recommend to have a quick look of my earlier post on how to use Excel Vlookup function.

Assuming that you have a sales data in cell Range A1:C6, and you want to find a sales number based on a product id, and you can use the following vlookup formula into a blank cell where you can to show the result.

Use of VLOOKUP function to Extract Approximate Matches


If you want to calculate the discount based on the quantity sold in your worksheet, and assuming that you want to search a sales number 60 to calculate its discount value, which doesn’t exist in your data A1:D6. And to search for an approximate  matches based on your specified sales number 60, just type the following VLOOKUP formula into cell G2.

=VLOOKUP(F2,C1:D6,2,TRUE)

use vlookup for approximate or exact match3

Note: the Cell F2 is the searched value which you want to get it the appropriate discount number. C1:D6 is the data range that you are using. The number 2 is that your matched value is returned. The TRUE value indicates that you want to calculate the approximate match.

Before applying the above formula, you need to make sure that your sales column is sorted in ascending order. Or the VLOOKUP formulas stop working properly and you will get a N/A errors.

Use of VLOOKUP function to get Exact Matches


Now let’s add this VLOOKUP formula in cell G2 to calculate the appropriate sales number based on the product id in cell F2.

=VLOOKUP(F2,A1:C6,3,FALSE)

use vlookup for approximate or exact match1

If you wish to search for multiple values in the same column, and you just need to drag the fill handle (G2) down to other cells to apply this formula.

use vlookup for approximate or exact match2

Note: you need to set a value for range_lookup argument, and it is set to FALSE or 0, VLOOKUP will find a exact match. And if it is set to 1 or TRUE, VLOOKUP will search for the closest match.

Related Functions


  • Excel VLOOKUP function
    The Excel VLOOKUP function lookup a value in the first column of the table and return the value in the same row based on index_num position.The syntax of the VLOOKUP function is as below:= VLOOKUP (lookup_value, table_array, column_index_num,[range_lookup])….

 

 

 

 

 

Related Posts

Build Hyperlink With VLOOKUP in Excel

You might have come across a task in which you were assigned to build hyperlinks, which seems very easy, and if you are new to excel or don't have enough experience with it, then you might wonder about doing this ...

Calculate Total Cost with Excel VLOOKUP Function

In today's article we will show you how to calculate the total cost for a given weight using the Excel VLOOKUP function. This function will help us to find the appropriate unit price for that weight and then we can ...

Basic Price Discount Calculation with Excel VLOOKUP Function

We often encounter product discounts in our shopping. Depending on the level of spending, the mall will offer different percentages of discounts. Usually, the more you spend, the bigger the discount, while the less you spend, the smaller the discount. ...

Calculate Grades With VLookup in Excel

Why Should You Calculate Grades With VLookup Excel? If you're looking for a simple way to find out a student's grades, VLOOKUP Excel can do the trick. This function uses a lookup table to find the values and sort them ...

Convert State Names To Abbreviations
abbr state names1

Assume that you got a task to convert the full state's name into the abbreviations in MS Excel, and for doing this task, you might choose to do it manually, which is an acceptable way only if you don't have ...

Find and Replace Multiple Values
find replace multiple values5

This post will guide you how to find and replace multiple values at once with VBA macro or using formula  in Excel. How do I make multiple find and replace in Excel. Suppose that you have a few cells containing ...

Excel XLOOKUP Function

Excel XLOOKUP Function was added into Excel as a beta feature in August 2019 and is now accessible exclusively in Microsoft 365. (as of July 2021). However, if you fall into this category and often deal with big sets of ...

VLOOKUP Formula | Faster Trick with 2 VLOOKUPS

This post will guide you how to use 2 VLOOKUPS function to looking up data entries from a given range of cells in Microsoft Excel. VLOOKUP with 2 lookups can be faster than a single VLOOKUP in certain scenarios. The ...

VBA Macro For VLOOKUP From Another Sheet
vba macro for vlookup from another sheet1

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

VLOOKUP From Another Sheet Not Working
vlookup from another sheet not working3

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you reasons why your VLOOKUP formula is not working ...

Sidebar