PC Review


Reply
Thread Tools Rate Thread

compare unsorted data across workbooks

 
 
aileen
Guest
Posts: n/a
 
      30th Sep 2008
I have 2 workbooks, one with 6 columns of data and the other with 12 columns
of data. Both have an unspecified number of rows. The data in the first
workbook(6 columns, A-F) needs to be compared with the data in the second
workbook(12 columns, but only columns G-L need to match the data in the
first worksheet columns A-F). I need to create a 3rd workbook showing the
data in the rows that did not match across the 2 workbooks. The first two
workbook's data are not sorted so the rows don't line up across the
workbooks.

e.g. workbook 1 data columns A-F
SPX OCT 2008 800 0 1200
SPX OCT 2008 900 0 -1400
SPX OCT 2008 975 0 200
workbook 2 data columns G-L
SPX OCT 2008 900 0 -1400
SPX OCT 2008 800 0 1200
SPX OCT 2008 975 0 100

The only data that will show up in the 3rd workbook is
SPX OCT 2008 975 0 200 and SPX OCT 2008 975 0 100

I have tried the excel addins compare.xla and workbook compare, but neither
seems to allow for rows that do not line up across workbooks. I believe I
will need to loop through one of the workbooks in order to check data for
this reason.

If this is at all possible, any help would be greatly appreciated
 
Reply With Quote
 
 
 
 
BobT
Guest
Posts: n/a
 
      1st Oct 2008
What you need to do is compare the union of the columns. If you can (want
to) add a column to each sheet that adds the key 6 columns together:

=A1&B1&C1&D1&E1&F1 (or whatever the columns are)

With these in place, you can then do a VLOOKUP to compare the two and report
the ones that don't match. You could do this with VBA too, but this might be
faster (though manual).


"aileen" wrote:

> I have 2 workbooks, one with 6 columns of data and the other with 12 columns
> of data. Both have an unspecified number of rows. The data in the first
> workbook(6 columns, A-F) needs to be compared with the data in the second
> workbook(12 columns, but only columns G-L need to match the data in the
> first worksheet columns A-F). I need to create a 3rd workbook showing the
> data in the rows that did not match across the 2 workbooks. The first two
> workbook's data are not sorted so the rows don't line up across the
> workbooks.
>
> e.g. workbook 1 data columns A-F
> SPX OCT 2008 800 0 1200
> SPX OCT 2008 900 0 -1400
> SPX OCT 2008 975 0 200
> workbook 2 data columns G-L
> SPX OCT 2008 900 0 -1400
> SPX OCT 2008 800 0 1200
> SPX OCT 2008 975 0 100
>
> The only data that will show up in the 3rd workbook is
> SPX OCT 2008 975 0 200 and SPX OCT 2008 975 0 100
>
> I have tried the excel addins compare.xla and workbook compare, but neither
> seems to allow for rows that do not line up across workbooks. I believe I
> will need to loop through one of the workbooks in order to check data for
> this reason.
>
> If this is at all possible, any help would be greatly appreciated

 
Reply With Quote
 
aileen
Guest
Posts: n/a
 
      1st Oct 2008
This is partially working, but I can only get the VLOOKUP to report the ones
that match. This is the code I'm using. Please let me know how to get the
unmatched data to appear instead of the matched data. This is the formula I'm
using:

=VLOOKUP($A$1:$A$500,$B$1:$B$500,1,FALSE)

Thanks very much for your help.

"BobT" wrote:

> What you need to do is compare the union of the columns. If you can (want
> to) add a column to each sheet that adds the key 6 columns together:
>
> =A1&B1&C1&D1&E1&F1 (or whatever the columns are)
>
> With these in place, you can then do a VLOOKUP to compare the two and report
> the ones that don't match. You could do this with VBA too, but this might be
> faster (though manual).
>
>
> "aileen" wrote:
>
> > I have 2 workbooks, one with 6 columns of data and the other with 12 columns
> > of data. Both have an unspecified number of rows. The data in the first
> > workbook(6 columns, A-F) needs to be compared with the data in the second
> > workbook(12 columns, but only columns G-L need to match the data in the
> > first worksheet columns A-F). I need to create a 3rd workbook showing the
> > data in the rows that did not match across the 2 workbooks. The first two
> > workbook's data are not sorted so the rows don't line up across the
> > workbooks.
> >
> > e.g. workbook 1 data columns A-F
> > SPX OCT 2008 800 0 1200
> > SPX OCT 2008 900 0 -1400
> > SPX OCT 2008 975 0 200
> > workbook 2 data columns G-L
> > SPX OCT 2008 900 0 -1400
> > SPX OCT 2008 800 0 1200
> > SPX OCT 2008 975 0 100
> >
> > The only data that will show up in the 3rd workbook is
> > SPX OCT 2008 975 0 200 and SPX OCT 2008 975 0 100
> >
> > I have tried the excel addins compare.xla and workbook compare, but neither
> > seems to allow for rows that do not line up across workbooks. I believe I
> > will need to loop through one of the workbooks in order to check data for
> > this reason.
> >
> > If this is at all possible, any help would be greatly appreciated

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare data in two different workbooks Dave Eade Microsoft Excel Misc 1 24th Feb 2010 11:14 AM
How do I compare data in 2 workbooks =?Utf-8?B?TXphbnNp?= Microsoft Excel Programming 5 2nd Feb 2006 06:30 PM
How can I compare data on 2 workbooks =?Utf-8?B?Sm9zaHVh?= Microsoft Excel Misc 1 22nd Jun 2005 04:07 PM
How do I compare two columns of unsorted data? =?Utf-8?B?TVJlcHA=?= Microsoft Excel Worksheet Functions 1 28th Sep 2004 07:07 PM
compare data in different workbooks Jerry H Microsoft Excel Worksheet Functions 1 21st Sep 2003 06:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:42 PM.