LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Matching Records in two tables

Hi Richard,

One approach would be to convert those duplicate values into uniques -
one way is like this in a helper column:

=A2&"_"&COUNTIF(A$2:A2,A2)

and copy down, assuming your values A,B,C,C,C,D are in column A
starting in row 2. These will show as A_1,B_1,C_1,C_2,C_3,D_1 in the
helper column, so they have been converted into unique references by
adding a sequential number to the end.

Hope this helps.

Pete

On Feb 20, 10:35*am, (Richard
Buttrey) wrote:
Hi,

I have two tables which I'm attempting to link with a common key
field. Table 1 contains all the records from table 2, plus additional
records not on table 2. Table 2 contains records that are not in table
1.

The field I'm matching on is common to both, and many records contain
the same key field value, but differences in other fields.

The task is to get the data from a non common field in table 2, and
add these field values to the table 1 records where the key field
matches.

I've tried to use an =MATCH() function, in table 1 to find the
equivalent row in table 2, but of course where there are more than one
record with the same key value, the MATCH() returns the same row
number. For instance with values A,B,C,C,C,D in table 2 rows 1:6, and
the same record values somewhere in table1, using a match in table
1for say value C in table 2, returns row 3 for the three 'C' values,
and not rows 3,4 & 5

I was hoping to use this Match value to either sort table 1 into
exctly the same order as table 2, and then copy the non common field
from table 2 into table1. Or alternatively loop down table 2 with a
macro and identify which rows need blank rows introducing to line up
with table 1.

I guess I need some variety of a countif() or sumproduct() function,
but I've not yet found the right flavour.

Can anyone offer any advice please?

Usual TIA

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


 
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
Find matching records in two tables using mulitiple criteria RC Excel Worksheet Functions 2 June 19th 09 11:41 PM
Matching Records Freshman Excel Worksheet Functions 8 April 2nd 08 05:17 AM
Matching Records in two tables Richard Buttrey Excel Worksheet Functions 2 February 21st 08 09:30 AM
Matching records RayB Excel Discussion (Misc queries) 1 July 18th 06 05:31 PM
Combine records from 2 tables whenever there are matching values . Excel Purge & Murge Mailing Lists Excel Programming 1 December 7th 04 01:05 PM


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