Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PF PF is offline
external usenet poster
 
Posts: 8
Default Merging Two Files

I have two spreadsheets with about 10 columns each. In the two files, 8 of
the columns are contain the same data, while the last two columns in each
file has unique data. The only difference in the two files are basically the
last to columns. File A has two unique columns and file B has two unique
columns. I need to create one file that compares 4 of the common columns in
each file, finding a match would copy all the common columns, plus the 2
unique columns from both files into the new file.
How can I accomplish this?

thanks in advance for any help offered...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Merging Two Files

Open both files, and in one file, use

=SUMPRODUCT(('[OtherFile.xls]Other Sheet'!A2:A1000=A2)*('[OtherFile.xls]Other
Sheet'!B2:B1000=B2)*('[OtherFile.xls]Other Sheet'!C2:C1000=C2)*('[OtherFile.xls]Other
Sheet'!D2:D1000=D2)* ROW(A2:A1000))

which will return the row of the 4 column match. Then use

=INDEX('[OtherFile.xls]Other Sheet'!E2:E1000,Cell with the formula above)
=INDEX('[OtherFile.xls]Other Sheet'!F2:F1000,Cell with the formula above)

to extract the matching data from column E and F (and any other columns that you need - but you
should only need two.....)

Obviously, change the names and ranges to match your actual layout.

HTH,
Bernie
MS Excel MVP


"pf" wrote in message
...
I have two spreadsheets with about 10 columns each. In the two files, 8 of
the columns are contain the same data, while the last two columns in each
file has unique data. The only difference in the two files are basically the
last to columns. File A has two unique columns and file B has two unique
columns. I need to create one file that compares 4 of the common columns in
each file, finding a match would copy all the common columns, plus the 2
unique columns from both files into the new file.
How can I accomplish this?

thanks in advance for any help offered...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
merging files Maaz New Users to Excel 3 March 1st 07 04:24 PM
merging zip files! via135 Excel Discussion (Misc queries) 2 November 19th 06 05:32 PM
merging two files mcap Excel Discussion (Misc queries) 3 April 9th 06 07:28 PM
merging two files morry[_20_] Excel Programming 7 June 22nd 04 08:15 PM
Merging Files rglasunow[_13_] Excel Programming 3 February 3rd 04 01:27 AM


All times are GMT +1. The time now is 01:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"