Hi Gary,
Use VLOOKUP function. Insert the list of data to look for (File-1 2500 rows)
in one worksheet (Sheet1) and the list of data to lookin (FILE-2 1 million
rows) in another worksheet (Sheet2).
Insert column headers in row 1 of both sheets. (Col1, Col2 etc will do)
Insert the VLOOKUP formula in column 4 Sheet2 with the 1 million rows as per
the example:-
Insert formula in cell D2
=VLOOKUP(A2,Sheet1!$A$2:$A$4,1,FALSE)
Where A2 is the value in the first column of sheet 2
Sheet1!$A$2:$A$4 is the full range of data to be looked up in sheet 1 (Not
including the column headers). Note that $A$2:$A$4 is in absolute mode with
the $ signs.
Copy the formula to the bottom of the data in Sheet2.
Found data will cause the matching value to be placed in the cell in column
D and those not found will have #N/A.
I suggest that after doing this you select all of column D and
copy->paste special->values
so that as you do further manipulations with the data, it does not try to
recalculate and cause your system to halt with the amout of data you have.
If you need further help to extract the data after that then get back to me.
Regards,
OssieMac
> I have two text files:
>
[quoted text clipped - 29 lines]
>
> Can someone provide step-by-step instructions on how I can do this?
gary - 15 Oct 2007 19:30 GMT
Thanks!!!
What should the formula be if:
In my Sheet1, the data is in A2.A2926
In my Sheet2, the data is in A2.C1000000 (however, I want to find
matches between only the cells in Col A of Sheet2 and the cells in Col
A of Sheet1).
Gary
OssieMac - 15 Oct 2007 22:04 GMT
Hi Gary,
Insert this in cell D2 of Sheet2 and copy it down.
=VLOOKUP(A2,Sheet1!$A$2:$A$2926,1,FALSE)
Don't forget to select column D and then Copy->Paste Special->Values after
it has finished calculating otherwise you might have difficulties with it
recalculating when you try to manipulate the data.
Best way to delete the rows not required is to sort on column D. That will
put all the #N/A's together and all the matched records together. However, if
you have a need to return to the original order after the deletion then you
need to first create an additional column with an index so that you can then
re-sort on the index. To do this:-
Insert a column header called Index (or any name you like) in cell E1.
In cell E2 insert =ROW()
Copy this formula to the bottom
You will have an index created from the row numbers.
Select column E and Copy->Paste Special->Values. (Must be done)
You can then sort on column D, delete the block not required and then sort
on column E to get back to the original order.
Regards,
OssieMac
> Thanks!!!
>
[quoted text clipped - 7 lines]
>
> Gary
gary - 16 Oct 2007 02:15 GMT
Perfect! (Just what I needed).
And I leaned something new.
Thanks, Ossiemac
gary - 16 Oct 2007 07:33 GMT
Perfect! (Just what I needed).
And I learned something new.
Thanks, OssieMac!