scalar email

VLOOKUP in Excel, part 2: Using VLOOKUP without a database

In a recent write-up, we presented the Excel feature called VLOOKUP as well as explained how it could be utilized to retrieve information from a database into a cell in a regional worksheet. In that write-up we stated that there were 2 usages for VLOOKUP, and also only one of them dealt with quizing data sources. In this short article, the 2nd as well as final in the VLOOKUP series, we examine this other, lesser recognized usage for the VLOOKUP function.

If you haven’t already done so, please read the initial VLOOKUP article– this article will certainly assume that most of the principles discussed because write-up are currently understood to the reader.

When collaborating with data sources, VLOOKUP is passed a “special identifier” that serves to recognize which data record we wish to discover in the database (e.g. an item code or client ID). This special identifier has to exist in the database, otherwise VLOOKUP returns us a mistake. In this article, we will certainly examine a means of making use of VLOOKUP where the identifier does not require to exist in the data source in any way. It’s practically as if VLOOKUP can adopt a “near sufficient is good enough” strategy to returning the information we’re trying to find. In certain conditions, this is specifically what we require.

We will highlight this short article with a real-world instance– that of determining the compensations that are generated on a set of sales figures. We will certainly begin with a really simple scenario, and afterwards considerably make it extra intricate, until the only reasonable remedy to the problem is to utilize VLOOKUP. The preliminary scenario in our make believe firm functions similar to this: If a salesperson creates greater than $30,000 worth of sales in a given year, the payment they gain on those sales is 30%. Or else their payment is only 20%. Up until now this is a pretty basic worksheet:

To utilize this worksheet, the sales representative enters their sales numbers in cell B1, and the formula in cell B2 determines the right commission rate they are qualified to get, which is made use of in cell B3 to calculate the complete payment that the sales representative is owed (which is a straightforward reproduction of B1 as well as B2).

The cell B2 consists of the only interesting component of this worksheet– the formula for making a decision which commission rate to utilize: the one listed below the limit of $30,000, or the one above the threshold. This formula uses the Excel function called IF. For those visitors that are not familiar with IF, it works such as this:

IF(problem, worth if real, worth if false)

Where the problem is an expression that evaluates to either real or incorrect. In the instance over, the condition is the expression B1

As you can see, using a sales

total amount of$20,000 provides us a commission rate of 20 %in cell B2. If we go into a worth of$40,000, we obtain a various payment rate: So our spreadsheet is working. Allow’s make it more intricate

. Let’s introduce a 2nd threshold: If the salesman makes more than$40,000, after that their compensation rate raises to 40 %: Easy enough to understand in the real world, but in cell B2 our formula is obtaining much more intricate. If you look very closely at the formula, you’ll see that the third criterion of the original IF function( the worth if false )is currently an entire IF function in its own right. This is called an embedded feature (a function within a function). It’s completely valid in Excel (it also functions!), but it’s more challenging to read as well as understand.

We’re not mosting likely to enter into the nuts and bolts of just how and why this works, neither will certainly we check out the subtleties of nested features. This is a tutorial on VLOOKUP, out Excel in general.

Anyhow, it worsens! What concerning when we make a decision that if they earn greater than $50,000 then they’re qualified to 50% compensation, as well as if they gain more than $60,000 then they’re qualified to 60% commission?

Currently the formula in cell B2, while appropriate, has ended up being practically unreadable. No-one should need to compose solutions where the features are nested four degrees deep! Surely there must be a simpler means?

There absolutely is. VLOOKUP to the rescue!

Allow’s upgrade the worksheet a little bit. We’ll maintain just the same numbers, however arrange it in a brand-new way, a much more tabular method:

Take a moment as well as verify on your own that the new Rate Table functions specifically the like the collection of thresholds above.

Conceptually, what we’re about to do is make use of VLOOKUP to search for the salesman’s sales total amount (from B1) in the rate table and also go back to us the corresponding commission price. Note that the salesman might have without a doubt developed sales that are not one of the five values in the rate table ($0, $30,000, $40,000, $50,000 or $60,000). They may have produced sales of $34,988. It’s vital to keep in mind that $34,988 does not show up in the price table. Allow’s see if VLOOKUP can resolve our issue anyway …

We select cell B2 (the location we intend to put our formula), and after that put the VLOOKUP feature from the Formulas tab:

The Function Arguments box for VLOOKUP appears. We fill out the arguments (parameters) individually, beginning with the Lookup_value, which is, in this case, the sales complete from cell B1. We place the cursor in the Lookup_value area and then click as soon as on cell B1:

Next we require to define to VLOOKUP what table to lookup this data in. In this instance, it’s the rate table, naturally. We put the arrow in the Table_array field, and afterwards highlight the whole price table– excluding the headings:

Next we should define which column in the table contains the info we desire our formula to go back to us. In this case we desire the payment price, which is located in the second column in the table, so we as a result go into a 2 right into the Col_index_num field:

Finally we get in a value in the Range_lookup field.

Vital: It is the use of this area that sets apart the two ways of utilizing VLOOKUP. To use VLOOKUP with a database, this final criterion, Range_lookup, must constantly be set to FALSE, but with this various other use of VLOOKUP, we need to either leave it empty or get in a value of TRUE. When making use of VLOOKUP, it is vital that you make the correct choice for this last specification.

To be specific, we will go into a worth of true in the Range_lookup area. It would also be great to leave it blank, as this is the default worth:

We have actually finished all the specifications. We currently click the alright switch, and also Excel builds our VLOOKUP formula for us:

If we try out a few various sales overall quantities, we can satisfy ourselves that the formula is working.

Verdict

In the “database” version of VLOOKUP, where the Range_lookup parameter is FALSE, the worth passed in the very first parameter (Lookup_value) must exist in the database. To put it simply, we’re seeking an exact suit.

But in this other use of VLOOKUP, we are not necessarily trying to find an exact match. In this case, “near adequate suffices”. However what do we indicate by “near sufficient”? Allow’s make use of an example: When looking for a compensation price on a sales total amount of $34,988, our VLOOKUP formula will certainly return us a value of 30%, which is the appropriate answer. Why did it select the row in the table including 30%? What, in fact, does “near adequate” mean in this situation? Let’s be exact:

When Range_lookup is readied to TRUE (or left out), VLOOKUP will search in column 1 as well as match the highest possible worth that is not more than the Lookup_value parameter.

It’s likewise important to keep in mind that for this system to function, the table should be arranged in rising order on column 1!

If you would like to practice with VLOOKUP, the sample data illustrated in this write-up can be downloaded and install from below.

Leave a Reply