Question

I'm not used to work in Excel. I have two excel files.

  1. In the first one I have one column with some data let's say hashed passwords.

  2. In the second file I have two columns: the first one contains password as in the first file while the second column contains other information related to the passwords.

I would like to create a sheet having the common passwords between the two files in the first column and the information on the second column (like an intersection).

My formula for the first column looks like this:

=IF(ISERROR(MATCH('path\[filename1]Sheet1'!A2;'path\[filename2]Sheet1'!$A$2:$A$106473;0));"";'path\[filename2]Sheet1'!A2)

While for the second column just the last A2 of the previous formula becomes B2. Dragging the mouse to the cells belows give me the result. Do you think is a good solution? Is there something better I can use to achieve my result?

Was it helpful?

Solution

Best to use the VLOOKUP function. See this SO post for a similar question and answer: Join two spreadsheets on a common column in Excel or OpenOffice

You can also use MATCH (I'm not sure if MATCH his more efficient than VLOOKUP). Let's say that Sheet1 contains:

Col A
pass1
pass8
pass3

and that Sheet2 contains:

Col A   Col B
pass1   info1
pass2   info2
pass3   info3
pass4   info4
pass5   info5
pass6   info6
pass7   info7
pass8   info8
pass9   info9
pass10  info10

Then copy the following to cell B1 in Sheet1 =INDEX(Sheet2!B1:B10,MATCH(A1,Sheet2!A1:A10,0),1) then fill down to enter the rest of the rows.

Result in Sheet1:

pass1   info1
pass8   info8
pass3   info3

Hope this helps...good luck, Paul

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top