Archive of Mr Excel Message Board


Back to Forms in Excel VBA archive index
Back to archive home

comparing data in 2 or more excell worksheets

Posted by Nan on August 28, 2001 1:04 PM
Does anybody know how to compare data in 2 or more worksheets? Specifically, I have a old price list in one worksheet that I want to compare to a new price list in a second worksheet.I want to be able to elimate outdated product numbers from the old price list. Thanks for the help!

Check out our Excel Resources

Have you tried using the vlookup function (NT)?

Posted by Eric on August 28, 2001 1:27 PM


Re: Have you tried using the vlookup function (NT)?

Posted by Nan on August 28, 2001 2:07 PM



Re: Have you tried using the vlookup function (NT)?

Posted by nan on August 28, 2001 2:08 PM

I don't know how to do a vlookup!!!!!



Re: Have you tried using the vlookup function (NT)?

Posted by Josef on August 29, 2001 4:51 AM


There is a very good explanation in the Excel Help file.


I'm not sure vlookup is what you need, but here's what it does in a nutshell

Posted by Eric on August 29, 2001 8:28 AM
Sorry I took so long to reply, lots of experiments this week.

Say in sheet1 you have a list of unique names in column A of a worksheet. On sheet2 you have a column of names that contains all or some of the names in sheet1. However, listed beside each name is the address in a separate column. Vlookup can "pull" that information from the second sheet and put it in the first.

Basically it uses the information from sheet1 colA to "look up" the row number in the sheet2 colA that contains the same info. Then it goes right a specified number of columns and retrieves information.

If you use the "fx" button at the top center of the tool bar and click on the "database and reference category" or the "all" category, you can find the vlookup function.

The first two selections are pretty straightforward, what value are you looking up? and what is the array in which you will look it up? The important thing to remember in the array, is that the lookup column will always be the leftmost column in the array, so you can't have "addresses" in col A and "names" in col B on sheet2 and have vlookup return addresses for names it looked up.

The third value it asks for is which column- remember here that it does not want a letter value, but the number of columns over in the array. For instance the column in which you are looking up values (the leftmost column in the array) is column 1, the column to the right of that is column 2, etc, independent of the column letter on which your array starts.

The last value is either "true" or "false". If you don't fill anything in it defaults to true, which I find annoying because "false" returns only "exact matches" rather than "closest matches", and usually I'm looking for exact matches. BTW there is also an Hlookup that does the same thing sideways (looks up across columns and a certain number of rows down; H= horizontal, V= vertical).

Hope that, on top of the help file, is of use to you- I actually didn't have much luck with the help file alone when I was figuring out Vlookup- I needed this board to help (I think it was Aladin) and a working example.

But asking the pros on this board to explain vlookup is like asking a rocket scientist to fix your lawnmower- fortunately I find lawnmowers very challenging!



This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.