Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Matching and Moving Data From One Spreadsheet to Another?

Hi all!

I *was* very proficient with Excel back in the days when you could use
the old command macro language, but haven't really had the chance to
get up to speed with Excel and the VBA (?) based language now used -
I'm not even sure I've described that accurately. Anyway...

I've got two spreadsheets of large enough size that I'd rather not do
this process by hand. One spreadsheet is pretty much a "subset" of the
other based on a few columns, e.g. "Name", "Address", "Age". I'd like
to take a row from the "subset" spreadsheet and copy the data
corresponding to "Name", "Address", "Age", etc. and paste it into the
"master" spreadsheet. The end result would be all rows found in the
"master" with additional data found in "subset" would be updated.

Here's an abbreviated example:

MASTER SPREADSHEET
col1 col2 col3 col4
a 1 2 3
a 4 7 2
b 5 6 7
c 8 9 0

SUBSET SPREADSHEET
col1 col2 col3 col4
a 1 z y
c 8 q r

RESULTING SPREADSHEET
col1 col2 col3 col4 col5 col6
a 1 2 3 z y
c 8 9 0 q r

Does that make sense? How do I approach this? Macros? Excel database
functions which I haven't had the opportunity to play with.

Thanks for reading!
Dennis

  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Matching and Moving Data From One Spreadsheet to Another?

It looks like you're matching up on both columns A and B--kind of an =vlookup()
with two keys.

If that's the case, you can use something like:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))
(one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

(still an array formula)

wrote:

Hi all!

I *was* very proficient with Excel back in the days when you could use
the old command macro language, but haven't really had the chance to
get up to speed with Excel and the VBA (?) based language now used -
I'm not even sure I've described that accurately. Anyway...

I've got two spreadsheets of large enough size that I'd rather not do
this process by hand. One spreadsheet is pretty much a "subset" of the
other based on a few columns, e.g. "Name", "Address", "Age". I'd like
to take a row from the "subset" spreadsheet and copy the data
corresponding to "Name", "Address", "Age", etc. and paste it into the
"master" spreadsheet. The end result would be all rows found in the
"master" with additional data found in "subset" would be updated.

Here's an abbreviated example:

MASTER SPREADSHEET
col1 col2 col3 col4
a 1 2 3
a 4 7 2
b 5 6 7
c 8 9 0

SUBSET SPREADSHEET
col1 col2 col3 col4
a 1 z y
c 8 q r

RESULTING SPREADSHEET
col1 col2 col3 col4 col5 col6
a 1 2 3 z y
c 8 9 0 q r

Does that make sense? How do I approach this? Macros? Excel database
functions which I haven't had the opportunity to play with.

Thanks for reading!
Dennis


--

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
Moving data from one spreadsheet to another Bishop Excel Worksheet Functions 4 March 24th 09 10:04 PM
Matching and Moving Data From One Spreadsheet to Another? [email protected] Excel Discussion (Misc queries) 1 March 18th 06 02:21 PM
Matching and Moving Data From One Spreadsheet to Another? [email protected] Excel Discussion (Misc queries) 1 March 18th 06 01:18 PM
Moving data to another spreadsheet... Guylaine_X Excel Programming 1 March 31st 05 06:35 AM
Copying and moving matching data problem Chad[_8_] Excel Programming 3 June 15th 04 06:46 PM


All times are GMT +1. The time now is 11:26 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"