Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
 
Posts: n/a
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
Dave Peterson
 
Posts: n/a
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
Matching two columns and their data [email protected] Excel Worksheet Functions 2 March 6th 06 08:17 PM
Moving data from from one worksheet to another imills Excel Worksheet Functions 1 January 13th 06 05:19 PM


All times are GMT +1. The time now is 08:54 PM.

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"