Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Raya
 
Posts: n/a
Default join two spreadsheets

How can I join 2 spreadsheets if I want both to update the fields of the main
file
by the fielda of the update file and to add the records of the update file
which aren't in the main file (I vannot use VLOOKUP in this case, or I don't
know how):
In my case I have the main file with records:
F1 F2 F3 ....
1 2 31
2 3 32
3 4 33
7 7 37
and I have to update it from the update file with fields
F1 F3
1 51
3 53
5 55
where F1 is the key field
as a result I must receive:
F1 F2 F3 ....
1 2 51
2 3 32
3 4 53
5 55
7 7 37

How can I do it?


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I'd create a new worksheet.
Copy the F1 columns from both worksheets to column A of that new worksheet
(but only one header row)

Then I'd use data|filter|advanced filter to get a list of unique dates
(eliminating duplicates)
Debra Dalgleish has a nice instruction page at:
http://www.contextures.com/xladvfilter01.html#FilterUR

Then delete column A (we'll have the unique values in the new column A)

Then use a bunch of =vlookup()'s to retrieve the values from the first sheet and
the second sheet.

For the F2 column (in B2 and drag down)

=if(iserror(vlookup(a2,sheet1!a:c,2,false)),"",
if(vlookup(a2,sheet1!a:c,2,false)="","",
vlookup(a2,sheet1!a:c,2,false)))

Then for the first F3 (from the original list) (in C2 and drag down)

=if(iserror(vlookup(a2,sheet1!a:c,3,false)),"",
if(vlookup(a2,sheet1!a:c,3,false)="","",
vlookup(a2,sheet1!a:c,3,false)))

Then for the second F3 (from the other sheet) (in D2 and drag down)

=if(iserror(vlookup(a2,sheet2!a:b,2,false)),"",
if(vlookup(a2,sheet2!a:b,2,false)="","",
vlookup(a2,sheet2!a:b,2,false)))

Now you've got all the data in one spot.

You can add a formula in E2 (and drag down).

=if(d2<"",d2,c2)
(If you have something in D2, keep it. Else use what's in C2.)

Then select column E and
edit|copy
edit|paste special|values

Delete (or hide) columns C and D.



Then in

Again, Debra Dalgleish's site:
http://www.contextures.com/xlFunctions02.html

For the F2 values

Raya wrote:

How can I join 2 spreadsheets if I want both to update the fields of the main
file
by the fielda of the update file and to add the records of the update file
which aren't in the main file (I vannot use VLOOKUP in this case, or I don't
know how):
In my case I have the main file with records:
F1 F2 F3 ....
1 2 31
2 3 32
3 4 33
7 7 37
and I have to update it from the update file with fields
F1 F3
1 51
3 53
5 55
where F1 is the key field
as a result I must receive:
F1 F2 F3 ....
1 2 51
2 3 32
3 4 53
5 55
7 7 37

How can I do it?


--

Dave Peterson
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
join 2 spreadsheets Raya Excel Discussion (Misc queries) 2 July 13th 05 11:16 AM
Excel Charts Linked to Spreadsheets Rich Charts and Charting in Excel 1 July 4th 05 04:36 PM
Problem with link cells between 2 spreadsheets Wellie Excel Discussion (Misc queries) 2 May 12th 05 05:30 AM
How do I get my actuarial spreadsheets to comply with SOx? Steven Geordie Boy Excel Discussion (Misc queries) 0 December 22nd 04 03:55 PM


All times are GMT +1. The time now is 06:39 PM.

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

About Us

"It's about Microsoft Excel"