excel programming vba - comparing lists
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » excel programming vba - Comparing Lists

excel programming vba - Comparing Lists

resolvedResolved · Low Priority · Version Standard

replyReplyThu 14 Jun 2007, 14:17Delegate Daryl said...

Comparing Lists

I have too worksheets of similar data (client ref; name, address, balance, dates).

There are some clients on one sheet but not the next and vice versa.

What is the easiest way to make the comparison? I currently am do the laborious method of going through it line by line (which takes several hours!)

For upcoming training course dates see: Pricing & availability

replyReplyMon 18 Jun 2007, 10:59Trainer Richard said...

RE: Comparing Lists

You can use the MATCH function to match the records from the one list against the other.

The answer you will get will be a number. This is a row number from the area you have chosen to match. If you do not get a number, that means that the value was not found, hence giving you your answer.

Here are some details regarding MATCH (you can also click on HELP in Excel to view similar info.)

------------
MATCH(lookup_value,lookup_array,match_type)
------------
Lookup_value is the value you use to find the value you want in a table.

Lookup_value is the value you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.

Lookup_value can be a value (number, text, or logical value) or a cell reference to a number, text, or logical value.

Lookup_array is a contiguous range of cells containing possible lookup values. Lookup_array must be an array or an array reference.

Match_type is the number -1, 0, or 1. Match_type specifies how Microsoft Excel matches lookup_value with values in lookup_array.

If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.

If match_type is 0, MATCH finds the first value that is exactly equal to lookup_value. Lookup_array can be in any order.

If match_type is -1, MATCH finds the smallest value that is greater than or equal to lookup_value. Lookup_array must be placed in descending order: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and so on.

If match_type is omitted, it is assumed to be 1.

replyReplyMon 18 Jun 2007, 14:59Delegate Daryl said...

RE: Comparing Lists

Thanks for your answer

When I do this, the first result #N/A is the first difference. I assume I then need to move the list order and reapply the formula to the rest of the list to get the correct match (or until get anohter #N/A result and repeat the process).

Is there any way of doing this comparison to automatically identify the differecnes without the manual altering of the list as I work down it

Regards
Daryl

replyReplyMon 18 Jun 2007, 16:05Trainer Richard said...

RE: Comparing Lists

Daryl

If you modify your original formula with an ABSOLUTE REFERENCE, before copying it down to the other values, then the range you will be looking into will remain the same.

So if your list is A2:B45
then you need to modify it woth $ signs to look like this

$A$2:$B$45

That locks the column and row references so that it does not change when copied.

I would check the first few results to make sure the formula is working properly before trusting the rest of them.

Regards

Richard


 

 

Excel tip:

Conditional Formatting in Excel 2010

If you have lots of data in a spreadsheet, you may find that it is easier to read if you highlight some of the values. This is Conditional Formatting and here's how to use it:

1) Select the data you wish to apply the format to and click Conditional Formatting
2) A list of options will then appear, from this list, choose the format you wish to display e.g. find all cells with a value less than 0
3) Excel will then highlight all of these cells

To remove this: select the highlighted cells, click the drop down on the Conditional Formatting icon and select Clear Rules from selected cells.

View all Excel hints and tips

forum postIs there discounts for the intermediate and advanced course once the introduction course has been attended?

» Forum post: Excel


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training