Comparing two columns

  • Thread starter Thread starter theintern
  • Start date Start date
T

theintern

I have 2 documents with 2 columns each. One document is old and one i
new.

They both have columns named "NAME" and "ID"
The documents don't have exactly the same names in them, but mostly do


What I need to do is to see if an ID is missing for a NAME in the ne
document, and if it is missing and if the old document has this ID fo
the given NAME, then put the ID from the old file into the new file.
have to check for all NAMES in the new document.

Any ideas
 
theintern said:
I have 2 documents with 2 columns each. One document is old and one is
new.

They both have columns named "NAME" and "ID"
The documents don't have exactly the same names in them, but mostly do.


What I need to do is to see if an ID is missing for a NAME in the new
document, and if it is missing and if the old document has this ID for
the given NAME, then put the ID from the old file into the new file. I
have to check for all NAMES in the new document.

Any ideas?
Hi,
One way would be to use the Vlookup()
If you have your NAME in column A and ID in column B you could use
something like this in a helper column C in the New document:

==IF(ISNA(VLOOKUP(A1,OldDucument!$A$1:$B$10,2,FALSE)),B1,VLOOKUP(A1,OldDocument!$A$1:$B$10,2,FALSE))

Then place the formula in C1 (If Row 1 is where your data starts) and
then paste it down the lenght of your dataset.

This should produce a list of matching Names and ID's from the Old
document.
If the name does not exist in the old document but in the new it will
get you the ID from column B.

Regards,
Bondi
 
Back
Top