Get approximate table data with the VLOOKUP function Excel 2013
Getting approximate table data with the VLOOKUP function
One of Excel's most powerful functions is the VLOOKUP function. It has a companion function called HLOOKUP. V means vertical, H means horizontal. VLOOKUP allows us to look up information and compare it with the left column of a vertical table. In column E, we want to look up the reduction for certain items that have been priced in column D. For example, if the subtotal, as we see it here, is 1363, if we were looking in this table we would be saying for example, It hasn't reached to 1500 so it's not 4.5%.
It's at a thousand therefore it's going to be 3%. The VLOOKUP function has two major forms. One of them is an exact match. We don't need that here. That would be for situations for example where you're trying to look up text entries or ID type numbers or we're trying to find something exactly. We wouldn't expect to find this number, the 1363 or any of these in this list although certainly one or two of them might be. And so the idea here is when we use VLOOKUP on a table, that table can be in a different worksheet, it could even be in a different workbook, but certainly for ease of use in testing it, it's going to be nearby.
We might later move it elsewhere, that wouldn't be a problem or it might originally be in a different location but when it's right here, it's just easier to work with. VLOOKUP tables, for situations like this, must have in their left column, numerical information in ascending order. We'll discuss later what happens when these are not in that order. We want to use VLOOKUP right here. I'm going to make the column wider so we can see this better and zoom in a bit also using the Zoom Slider bar.
So in cell E3, now what if you have used a function but it's been a long, long time or maybe all you know about a function is its name? Rather than typing in a function and making lots of guesses and going back to books and trying to figure out how to make it work, what you might consider doing is clicking the fx, the Insert Function button to the left to the Formula Bar. So let's imagine we're about to use VLOOKUP here, we know maybe a little bit about it, we've heard about it possibly. We click fx. It might turn up in a list of recently used functions.
We could possibly narrow it down by referring to Lookup and Reference functions; maybe we'll go there or in the list of all functions, too. Lookup and Reference should be in this list. We'll scroll up and down, it's there alphabetically. There it is, a brief description of it here and we click OK. We actually see it being displayed here and Excel we'll build this for us as we look at it. What is it we're trying to look up? It's this value in D3, this charge for an order.
We're trying to see if there's a reduced rate for it. The table that we're looking at is off to the right and it's in these cells right here, so we will highlight those. Column index number, this throws people at first often. Which column of the table has the answers that we're looking for? What we'd like to come up with here is a percent. There's already a formula which we haven't seen yet in column F, it's going to use this percent to adjust the charge total by reducing the amount. So the column that has the answer is the second column.
So we put in the number 2 here. Now there are situations where you need an exact match. We don't need that here so the fourth argument of VLOOKUP is often not used if the data is approximate. We don't need to worry about that at all. We simply ignore it. So, we can simply press OK or Enter. We should have an answer here and there it is. It's 3% and that's what you would have guessed it is. It hasn't reached the 1500 level which would be 4.5. It's at the 1000 level of 3%. We do see the Adjusted Total here.
Here's the formula that works off of that percent and you see how it's set up. It's always best to test these out by dragging them but before dragging this, do we need to really make a change here? I think a lot of you know if you've worked with certain kinds of data if you're familiar with the idea of relative and absolute references, the reference to this table needs to be made absolute. Drag across this address of cells, press the Function key F4, that makes it an absolute reference then we can copy this down.
Let's copy down a few cells just to get the feel of how this is working for other values and each of those should check out properly based on the table on the right. Recognize something about this table, it only goes to 2500, some of our values might go higher. So what happens in this case right here? This is well above 2500. It's simply reversed to the highest entry in the table which you've got to be much more careful with the low end of these tables. One of our amounts here is a $159. What if we started the table at 1% and our first amount here is $200? In other words we're saying there's no reduction until you reach 200.
There's 159 over there, what's going to happen now? We've got a problem here. So you want to make sure that in your VLOOKUP tables when you're using an approximate match that you do cover the lowest possible entries that might occur. I'm going to press Ctrl+Z twice to take the table back to its prior form. So we see what happens there when we are not covering the lowest entry. Let's make another change here and I will do this on purpose. What if the numbers are not in ascending order? If this is 4500 right here, instead of 1500, the problem will be that we will have answers.
Some of them will be wrong though, but they won't necessarily jump out at you. As soon as I press Enter, you'll see some of the answers in the column E change, but not all of them. And some of them are still accurate so it can be very misleading at times. You always want to make sure when you're using VLOOKUP for approximate matches where you've got numbers representing break points, these must be in ascending order as we look down the table. So, I'll press Ctrl+Z again and some of those entries in column E will not be corrected. Ultimately, we don't really need to make column E this wide, we'll simply DoubleClick the boundary.
We've used our VLOOKUP function here to look up data in a very efficient way. That table might be in a different worksheet, different workbook, but it works smoothly and nicely when it's nearby and you can check out its totals. One improvement we could make to make this even simpler is if we know there is no other data in columns H and I, instead of having this somewhat complex looking reference, let's simply drag across the columns H and I. And that notations style referring to the entire columns works just fine here and we can recopy that, we'll DoubleClick on the lower righthand corner.
All of these entries now refer to columns H and I and it's much easier as we view the function to figure what's going on. We don't have to worry about absolute addresses. So another adjustment to the VLOOKUP capability which accentuates how easy this function is to work with. A powerful tool to be sure.
Getting approximate table data with the VLOOKUP function provides you with indepth training on Business. Taught by Dennis Taylor as part of the Excel 2013 Essential Training
 Subjects:
 Business Education + Elearning
 Software:
 Excel
 Author:
 Dennis Taylor

1m 6s

 Welcome

43s


29m 37s

 What is Excel used for?

1m 49s

 Using the menu system

4m 30s

 The Quick Access Toolbar

4m 41s

 Using the Formula bar

1m 43s

 Using the Status bar

2m 24s

 Using the builtin help

2m 54s

 Creating new files

2m 11s


24m 1s

 Working with dates and times

3m 32s

 Using Undo and Redo

4m 50s

 Adding comments

2m 55s

 Using Save or Save As

3m 57s

30m 7s

 Using SUM and AVERAGE

3m 25s

46m 7s

 Designing borders

3m 26s

 Formatting numbers and dates

4m 31s

 Conditional formatting

4m 21s

 Creating and using tables

9m 59s

20m 40s

17m 51s

30m 30s

 Creating charts

4m 36s

 Exploring chart types

7m 47s

 Formatting charts

5m 42s


12m 49s

23m 0s

20m 25s

23m 50s

 Protecting workbooks

2m 40s

 Sharing workbooks

4m 7s

 Tracking changes

4m 32s

28m 32s

 Sorting data

6m 9s

 Using filters

6m 16s

 Removing duplicate records

2m 38s


35m 2s

 Creating PivotTables

8m 36s

 Manipulating PivotTable data

9m 47s

 Grouping by other factors

2m 33s

 Using PivotCharts

3m 59s


23m 29s

 Using Goal Seek

6m 8s

 Using Solver

6m 34s

 Using Scenario Manager

6m 11s

 Using Data Tables

4m 36s


24m 31s

 Definition and examples

6m 48s

 Creating a simple macro

7m 0s

 Running a macro

10m 43s


29s

 Next steps

29s

Related Courses

Excel 2010 Essential Training6,004,543 Views

Word 2013 Essential Training1,681,273 Views

Access 2013 Essential Training2,706,153 Views

PowerPoint 2013 Essential Training1,667,653 Views

Excel 2013: Pivot Tables in Depth1,331,864 Views

Access 2013 Essential Training2,706,153 Views

Word 2013 Essential Training1,681,273 Views

Excel 2010 Essential Training6,004,543 Views

PowerPoint 2013 Essential Training1,667,653 Views

Foundations of Programming: Fundamentals7,748,469 Views