Showing posts with label VLOOKUP. Show all posts
Showing posts with label VLOOKUP. Show all posts

Sunday, September 23, 2012

And the winners of the great white shark VLOOKUP is...

VLOOKUP Week's Great White Shark Award WinnerJP Pinto!  Congratulations!

His contribution was one of the seven selected by Bill Jelen as the most innovative, while VLOOKUP weekreleased.  He won a copy of that book Bill Jelens Microsoft Excel 2010 in depth. You can find links to all seven posts and the results of voting in our summary of the VLOOKUP week postsee.

JP Pinto post cascading validation lists will show you how you select and use VLOOKUP function, create a set of drop-down lists, the "", Cascade so that the choices in a second list depends on depending what you, a first list choose. You can restrict the choices these lists, displayed to the user in list boxes.

Cascading Dropdown List

JP Pinto blogs on Excel-User.com, where he writes Excel articles for common users to help improve their skills.


View the original article here

Sunday, September 2, 2012

You asked about VLOOKUP

@timjs: Here’s a bit more information, from a friend in product support (thanks, Ryan!):


“Most of the issues we see in Excel 2007/2010 deal with an old way of making sure to get everything included in the VLOOKUP. Namely, using the entire column as a range (for example, C:H) instead of where your data actually lies (for example, C1:H5000).  In Excel 2003, this wasn’t a big issue because this version had a smaller number of worksheet cells to look through. However, with the increased row and column limits in Excel 2007/2010, this may cause performance issues. In other words, with a formula like =VLOOKUP(B1,C:H,2,FALSE), every time Excel wants to calculate that cell it needs to look through about 6.3 million cells.  If you have a VLOOKUP formula in thousands of cells, you will definitely see a performance hit.”


This may not be the root of your issue with pasting, Tim, but I think it’s worth sharing here, so that others can avoid potential performance pitfalls when working with VLOOKUP. Without seeing your workbook, it's hard to troubleshoot. Again, I'd send you to MS Answers and also refer you to these four excellent articles:


Excel 2010 Performance: Performance and Limit Improvements


msdn.microsoft.com/.../ff700514.aspx


Excel 2010 Performance: Tips for Optimizing Performance Obstructions (see the Lookups section)


msdn.microsoft.com/.../ff726673.aspx


Excel 2010 Performance: Improving Calculation Performance


msdn.microsoft.com/.../ff700515.aspx


Improving Performance in Excel 2007


msdn.microsoft.com/.../aa730921(v=office.12).aspx


Hope it helps.


- Anneliese


View the original article here

Wednesday, June 13, 2012

VLOOKUP week wraps up: vote for your favorite post

VOTE FOR YOUR FAVORITE VLOOKUP POSTVLOOKUP week ended. The idea of Excel MVP Bill Jelen, inspired the idea of all VLOOKUP, VLOOKUP track Oden haikus, vampires, and shark attacks.

If all beiseite-fun - Excel experts crazy several useful and innovative applications of VLOOKUP in seven days created. The week could be but thanks to the enthusiasm of the community Excel and on the Web, the information continue to have Excel users at all levels of experience. So thank you, Bill, and thanks to Excel community.

Here, Bill's wrap-up:

Many people from around the world submitted VLOOKUP week many exciting tips and tricks about VLOOKUP. I moved seven of the most innovative contributions for your enjoyment. Do she these contributions from one you like the best? Take the two-second poll below and let us know. The top vote-getter will win under the name "Great White Shark" VLOOKUP week and a copy of my book Microsoft Excel 2010 in depth.

= INDEX (MATCH (EXACT case search by Tom Urtis=RELATED() in Powerpivot by Rob Collie=INDIRECT() to a variable sheet by James Chen= VLOOKUP with select search links from Richard Schollarusing VLOOKUP in validation by JP PintoVLOOKUP, OFFSET, and MATCH double lookup by Javier Guillenimproving VLOOKUP with two VLOOKUPS from Charles Williams speed ))

Bill Jelen is the host of MrExcel.com and author of 34 books on Microsoft Excel.


View the original article here

Monday, June 11, 2012

VLOOKUP Tutorial: Updating prices in a master price list

AppId is over the quota
AppId is over the quota

In honor of VLOOKUP Week, MVP Bill Jelen has created a VLOOKUP tutorial for those of you who have a basic working knowledge of Excel but want to improve your skills. This tutorial assumes you know a little something about writing basic formulas in Excel. It assumes that you've heard of VLOOKUP and its benefits, but that you don't really know how to use it. Bill uses the example of updating prices in a product list to explore the following topics:

Part 1:  The Problem: It's taking way too long to find and update prices in a master price list

Part 2: The Solution: Using VLOOKUP to automatically update the price list

Suppose that you maintain an Excel workbook with over 10,000 prices for products that your company sells. Parts are arranged in sections by category. You have part numbers in column A, prices in column B, and other information in column C. Now, imagine that your manager just gave you a worksheet with updates for 475 of the items in your list.

Attempt 1: Using CTRL + F to update the list

You decide to copy the price update to a blank section of your master price list.

From this point, you start trying to find each item from the new list in the old list. Since the items in the old list are not sorted and cannot easily be sorted across the various sections of the price list, you decide to use the Find command to make the process easier.

Here is your first attempt:

Select the first part number from the new list in cell G3Press Ctrl+C to copy this item to the clipboardSelect all of column A by clicking on the A headingPress Ctrl+F to open the Find dialogPress Ctrl+V to paste the part number into the Find dialogClick the Find button

You are now at row 2063 and fairly proud that you didn't have to click PgDn one hundred times to get here. Unfortunately, you've forgotten the new price so you have to start over.  

Watch me try using CTRL + F to update the list:

Attempt 2: Using Find All to update the list

You try jotting the new price on a sheet of scrap paper, but then you think there might be a faster way. After some experimenting, you end up with this awesome set of steps:

Select the next part number from the new list (you are down to G9) by now.Press Ctrl+C to copy that cell to the clipboardPress Ctrl+A twice to select all cells in the worksheetPress Ctrl+F to open the Find dialogPress Ctrl+V to paste the part number in the Find dialogPress Alt+A to Find All! This brings up a list of both the item in the original list and the item in the new listSwitch between the two cells using the up and down arrow keys.At this point, it is probably easier to switch to the mouse. Click on the new price. Right-click and choose Copy. Click on the old price. Right-click and choose paste.You can return to the right section of the new price list using the hyperlinks in the still-open Find dialog.

Watch me using Find All to update the list: 

Even with this improved set of steps, it is taking almost 1 minute per item. You do some quick math and realize that 450 items are going to require 8 mind-numbing hours. Your first thought might be, "There has to be a better way, but what is it?" 

I began working as a financial analyst in 1989. I've learned that data is rarely perfect.

This price list workbook is a case in point. It has been handed down in your department for the last dozen years. It was set up by some guy named Bob who no longer works here. In the workbook, there are lots of things that would have made life easier.

For example, it would have been nice if:

The category information was in another column, so you could easily sort the list by part number and then back by category.The list of new prices included all the items where the price did not change, and if it was in the exact same order as your list, so you could copy and paste huge ranges of prices.Your manager would have just done this himself.

But, in real life, data is not perfect. When data is not perfect, knowing an Excel function called VLOOKUP can save the day.

VLOOKUP formula explained

VLOOKUP stands for "Vertical Lookup." The vertical means that your list of new prices is going down the spreadsheet instead of across. (If you are wondering, there is an HLOOKUP for when your lookup table is going across.)

The tooltip for VLOOKUP says you need:

=VLOOKUP(lookup_value,table_array,col_index_number,[range_lookup])

Lookup_value is the part number that you are looking up. To find a new price for the part number in A2, you are looking for A2. =VLOOKUP(A2,Table_array is the lookup table. The data that you are looking to match must be in the first column of the lookup table. That works in this case, because part number is in column G and new price is in column H. If those had been reversed, you would copy the prices so they are to the right of the part numbers. When you type the address of the table, make sure to use dollar signs so that the table reference doesn't change as you copy the formula down your worksheet. Instead of G3:H477, use $G$3:$H$477. Those dollar signs tell Excel to not lower the range as the formula gets copied down. =VLOOKUP(A2,$G$3:$H$477,Col_index_number tells Excel which column you want to return from the lookup table. In this case, you only have two columns. Part number is in the first column of the lookup table. New Price is in the second column of the lookup table. Since you want to return New Price, use 2 for the column. =VLOOKUP(A2,$G$3:$H$477,2Range_lookup - the square brackets in the tooltip say that this argument is optional, but in real life it is not optional! You should always put False as the fourth argument. If you leave the argument off, you are allowing Excel to find close matches. Close matches are never appropriate when you are doing the type of lookup described in this situation. =VLOOKUP(A2,$G$3:$H$477,2,False)

Add a new column to your price list called New Price. Enter =VLOOKUP(A2,$G$3:$H$477,2,False) in cell C5. You get the new price. This looks promising! 

Your first VLOOKUP returns the new price

Select the formula in C5 and double-click the fill handle to copy the formula down. (The fill handle is the square dot in the bottom right corner of the selected cell.) Because of the blank cells between categories, the fill handle will only copy the formula down to the end of the first category. Already, you can see that something seems to be wrong. 

 

Uh-oh! #N/A errors are usually bad, but maybe not in this case

Techniques for dealing with inevitable #N/A errors

A few of the VLOOKUP formulas are returning numbers. Many more are returning the #N/A error. When you do a VLOOKUP, the #N/A error means that the value you are looking up is not found in the lookup table. In this case, this is to be expected, since only 475 of the 10,000 prices are being updated.

Since you are expecting the #N/A errors, you can use the IFERROR function (available in Excel 2007 or later) to replace the #N/A with something else. You might put a space. You might put a zero. Or...in this case, if you don't have a new price, then the old price is still valid, so you could put the old price!

Edit the original formula in C5. Here are the three formulas you could use:

To show a blank, use =IFERROR(VLOOKUP(A5,$G$3:$H$477,2,FALSE),"")To show a zero, use =IFERROR(VLOOKUP(A5,$G$3:$H$477,2,FALSE),0)To use the old price, use =IFERROR(VLOOKUP(A5,$G$3:$H$477,2,FALSE),B5)

Choose a formula and copy it down. Your new column shows the new price if there is one, and the old price if there isn't one. 

 

 =IFERROR() to the rescue

In this video, see how I define VLOOKUP and explain the VLOOKUP formula, and get rid of #N/A: 

 Come back tomorrow for Part II, where you'll how to use conditional formatting to highlight the items with new prices, and more...


View the original article here

Tuesday, April 3, 2012

Today's Giveaway: Odes to VLOOKUP (It ain't over until the formulas stop signing)

AppId is over the quota
AppId is over the quota

Bill Jellen found it. Erica Rhein started it. She posted a comment on Facebook declaring her complete dependence on VLOOKUP.

"I use Pivot Tables and VLOOKUP every day. I would be screwed at my job without it"

To Bill's formula-possessed mind this equals a love poem. He decided today's VLOOKUP Week door prize would be the best ode to VLOOKUP. Check out the haikus and poems about undying VLOOKUP love (or is that HOOKUP?)  that have been already submitted, then add your own by entering it as a comment to this VLOOKUP Week blog post.

BTW:  Do you think this entry is the first VLOOKUP love poem ever written?

How do I love thee?
Let me count the ways ...

The tens of thousands of records, nay,
The now 1,048,576 potential records per sheet,
A full 16,384 potential fields wide,
Would be a mountain of bad data
Too high to climb...

Whether tracking statewide underground facility excavation violations,
National subcontractors' software bug fixes,
Or hospital CFOs' every financial metric desires,
My eyes grew weary and my fingers waxed numb
With every scroll up and down those endless records,
Scanning for that needle of a matching value
In a towering haystack of a list -
Over and over and over again.

--Kip J.

One final note:  Today Bill's also featuring a post about using VLOOKUP to track shark attacks written by Debra Dalgleish who also wrote about VLOOKUP Vampires. What can Bill possibly give away that relates to those?


View the original article here

Ride the Shark! It's VLOOKUP Week March 25-31, 2012

AppId is over the quota
AppId is over the quota

VLOOKUP left

If Lookup Value is in Cell C1, Lookup Column is B and Result Column is A, then the “VLOOKUP left”  formula will be =OFFSET(B1,MATCH(C1,B:B,0)-1,-1)

Last Matching value

If Lookup Value is in Cell C1, Lookup Column is B and Result Column is A, this array formula will result the last matching value: =OFFSET(B1,MAX(IF(C1=B:B,ROW(B:B)))-1,-1). This formula should be entering as an array formula (Click the formula bar and press Control+Shift+Enter). If you are using Excel 2003, specify the range like B1:B20, instead of entire column B:B.

Intermediate Matching values

If Lookup Value is in Cell C1, Counting of the lookup value is in cell D1, Lookup Column is B and result Column is A, this array formula will result the intermediate matching value: =OFFSET(B1,SMALL(IF(C1=B:B,ROW(B:B)),D1)-1,-1). This formula should be entering as an array formula (Click the formula bar and press Control+Shift+Enter). If you are using Excel 2003, specify the range like B1:B20, instead of entire column B:B.


View the original article here

Monday, April 11, 2011

She asked VLOOKUP

People are crazy for the Excel function VLOOKUP, and why not? Among other things, VLOOKUP is known for his rugged good looks and unique martial arts ability.

All seriousness VLOOKUP is one of the most common and versatile functions in Excel. Typically, use you quickly look it up and to extract specific bits of information from a large list of data. The following example I VLOOKUP to search for a page ID to a different worksheet, find a corresponding page name need have, and to take, that page names back in the cell, where I entered the formula. (Yes, "put you down.")

Example of using VLOOKUP to extract page names

Because VLOOKUP is one of the top search engines queries on Office.com, we collect some questions about how you have used it. Here is a collection of resources, with which you can learn or fix.

If you know not much about VLOOKUP, you start here.

Video-based training that provides detailed information about the VLOOKUP, including a Übungsdatei and a quick reference card.

Help article, which describes the formula syntax in detail and provides examples. Only the facts, Ma'am.

Printable card for those who use the VLOOKUP rarely and therefore need help remembering the function's arguments (in plain English, the information between the brackets the function says, is what to do).

Video series which covers not only VLOOKUP all reference features in Excel. (If you don't know video series on YouTube about Mike Girvin "Excelisfun", take a look and see what you think.) (I find these videos to be enormously helpful.)

Once you locate it, problems can occur. These resources can help.

Printable map, the techniques to avoid or manage # N/A error explains.

Post by MVP Greg Truby , of these very frequently asked questions addresses:

How can I values based on more than one column? Why do I get a # N/A error, although the search value is valid?What can I do if I return a value, based on the left side of the lookup field?

Article by MVP Bill Jelen , that explains a little more about this last point above-that VLOOKUP uses always the first column into a lookup table as a starting point. If not, that work for your situation, you can INDEX and MATCH instead of VLOOKUP.

Free tech support forum to specific questions about VLOOKUP and get answers by Excel MVPs and other Excel users. Here are, for example, existing threads across multiple VLOOKUPs and conditional VLOOKUPs.

No doubt there are many useful articles and tutorials are. Have a personal favorite, or a good tip, feel free you please share it with us.

--Anneliese Wirth


View the original article here