Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Merge data from two separate tables

I want values from table two to be copied into table one where 2 cells from a
row in table 2 matches 2 cells in a row from table one. Examples: if b6
(table 1) equals a value in column b (table 2) and d6 (table 1) equals a
value in column d (table 2), then e6 (table 1) will equal value €œaok€ from
column d (table 2). Any ideas?


worksheet 1
a b c d e
1 code item# name SUBC plant
2 a12 1001 s1f 1 aok
3 a12 1002 s1f2 k bal
4 a12 1003 tex 1 bal
5 a14 1004 saf s aok
6 a14 1005 plc 1
7 a15 1006 wak 1 bal

worksheet 2
a b c d e
1 code item# name SUBC plant
2 a12 1001 s1f 1 bal
3 a12 1007 win k aok
4 a14 1005 plc 1 aok


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Merge data from two separate tables

If you are guaranteed to have only one matching row then you can use a
combination of MATCH() and INDEX(). You'd use the MATCH() function to
compare the combination of values in Table 1 columns B & D to the whole
columns B & D in table 2, like so (entered as an array formula by pressing
Ctrl-Shift-Enter)

=match(b6&d6,'other sheet'!$b$2:$b$2000&'other sheet'!$d$2:$d$2000,0)

That will tell you the row in the table that matches, or give you an error
if there is no match. To get the value from column E, use INDEX()

=INDEX('other sheet'!$e$2:$e$2000, match(b6&d6,'other
sheet'!$b$2:$b$2000&'other sheet'!$d$2:$d$2000,0))

If there is no match, you'll get an error, so you may want to wrap the whole
thing in an IFERROR() [if you have Excel 2007], or an If(iserror()) if you
have an earlier version

The combined formula must be entered with Ctrl-Shift-Enter

=INDEX('other sheet'!$e$2:$e$2000, [number from MATCH()])



"brownmre" wrote:

I want values from table two to be copied into table one where 2 cells from a
row in table 2 matches 2 cells in a row from table one. Examples: if b6
(table 1) equals a value in column b (table 2) and d6 (table 1) equals a
value in column d (table 2), then e6 (table 1) will equal value €œaok€ from
column d (table 2). Any ideas?


worksheet 1
a b c d e
1 code item# name SUBC plant
2 a12 1001 s1f 1 aok
3 a12 1002 s1f2 k bal
4 a12 1003 tex 1 bal
5 a14 1004 saf s aok
6 a14 1005 plc 1
7 a15 1006 wak 1 bal

worksheet 2
a b c d e
1 code item# name SUBC plant
2 a12 1001 s1f 1 bal
3 a12 1007 win k aok
4 a14 1005 plc 1 aok


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
Merge data from two separate tables brownmre Excel Discussion (Misc queries) 3 February 22nd 10 06:30 PM
How can I refresh data in pivot tables lcoated in separate tabs? Jim Thomlinson Excel Discussion (Misc queries) 1 August 17th 07 02:10 AM
How can I refresh data in pivot tables lcoated in separate tab DavidG Excel Discussion (Misc queries) 0 August 17th 07 01:54 AM
How can I refresh data in pivot tables lcoated in separate tab Jim Thomlinson Excel Discussion (Misc queries) 0 August 17th 07 01:43 AM
how do I merge data from separate spreadsheets Gary Milks Excel Discussion (Misc queries) 1 June 27th 06 12:52 PM


All times are GMT +1. The time now is 08:12 AM.

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"