I have 3 spreadsheet. Sheets 1 & 2 have a common field.
If this matches then I need to return the data in other
column associated with the common field, but not the common
fields.
After the data is filled in from the 2nd sheet, then there
will be a common field from sheet 1 & 3. Then I need to
match up those fields and pull over the assocaited data and
fill in the columns. Need help ASAP!!!
What you seem to be looking for is a database inner join. This'd be much easier
to do using Data > Get External Data *if* you know SQL. It could be as simple as
SELECT TBL1.Val_1, TBL2.Val_2
FROM `D:\tmp\tst1`.TBL1 TBL1, `D:\tmp\tst2`.TBL2 TBL2
WHERE TBL1.ID = TBL2.ID
If you don't know SQL, then if you have all three sheets open, and the common ID
field is the first column in sheets 1 and 2, you could try the following
approach. I'll assume the result should begin in A1 in sheet 3. Also, I'll
assume the entire tables in sheets 1 and 2 are named, respectively, TBL1 and
TBL2.
First get the field names from the other tables.
A1:
=INDEX(TBL1,1,2)
B1:
=IF(COLUMNS(TBL1)>COLUMN(),INDEX(TBL1,1,COLUMN()+1),
INDEX(TBL2,1,COLUMN()-COLUMNS(TBL1)+2))
Fill B1 right until it generates #REF! errors.
Next find the field values for the first record.
A2: [array formula]
=IF(COUNTIF(INDEX(TBL1,1,0),A$1),
HLOOKUP(A$1,TBL1,SMALL(IF(COUNTIF(INDEX(TBL2,0,1),INDEX(TBL1,0,1))
*(ROW(TBL1)-CELL("Row",TBL1)+1)>1,COUNTIF(INDEX(TBL2,0,1),INDEX(TBL1,0,1))
*(ROW(TBL1)-CELL("Row",TBL1)+1)),ROW()-1)),
HLOOKUP(A$1,TBL2,SMALL(IF(COUNTIF(INDEX(TBL1,0,1),INDEX(TBL2,0,1))
*(ROW(TBL2)-CELL("Row",TBL2)+1)>1,COUNTIF(INDEX(TBL1,0,1),INDEX(TBL2,0,1))
*(ROW(TBL2)-CELL("Row",TBL2)+1)),ROW()-1)))
Fill A2 right as far as needed to correspond to field names in row 1. Let's say
there were 6 fields in totoal, so fill A2 into B2:F2. Then select all cells in
row2, so A2:F2, and fill down as far as needed until you get #REF! errors.
While it is possible to construct fairly general inner joins in Excel, it makes
a lot more sense to learn how to use SQL quesries to do this.