G
Guest
I have a list of countries in column 1 with corresponding values in column
2. I have a second spreadsheet with the same countries (usually spelled the
same way) in column 1 and a new set of values in column 2.
For example:
SS1 cols 1,2:
Afghanistan $50,000
Bangladesh $25,000
Bangladesh-Dhaka $10,000
SS2 cols 1,2:
Afghanistan $100,000
Bangladesh $35,000
Bangladesh-Dhaka $20,000
I would like to automatically have SS1 result in the following in cols. 1,2,3:
Afghanistan $50,000 $100,000
Bangladesh $25,000 $35,000
Bangladesh-Dhaka $10,000 $20,000
I use the functions to automate this as follows:
=IF(ISNA(MATCH(A1,Sheet2!$A$1:$A$100,0)),"NotFound",VLOOKUP(A1,Sheet2!$A$1:$B$100,2,0))
And is works ok.
My question:
any countries where the spelling is slightly different on each spreadsheet,
is there a way to automate the correction process to create an exact match.
For example, to auto correct Bangladesh - Dhaka to Bangladesh-Dhaka (without
the spaces on either side of the hyphen which prevents a match). Or
elimination of leading or trailing spaces which also prevents a match, or
correction of Bangladesh (Dhaka) to Bangladesh-Dhaka to enable a match.
I'm trying to avoid human intervention. There are probably only 5-6
variations (extra spaces; parenthesis to hyphens, etc.) which would have to
be checked and corrected. Is there a macro or something which could
accomplish this?
Or can MATCH be changed so it finds the closest match even if not exact?
Etc.?
hopefully, some or all of the above is possible and can be automated.
appreciate
your help. thanks
2. I have a second spreadsheet with the same countries (usually spelled the
same way) in column 1 and a new set of values in column 2.
For example:
SS1 cols 1,2:
Afghanistan $50,000
Bangladesh $25,000
Bangladesh-Dhaka $10,000
SS2 cols 1,2:
Afghanistan $100,000
Bangladesh $35,000
Bangladesh-Dhaka $20,000
I would like to automatically have SS1 result in the following in cols. 1,2,3:
Afghanistan $50,000 $100,000
Bangladesh $25,000 $35,000
Bangladesh-Dhaka $10,000 $20,000
I use the functions to automate this as follows:
=IF(ISNA(MATCH(A1,Sheet2!$A$1:$A$100,0)),"NotFound",VLOOKUP(A1,Sheet2!$A$1:$B$100,2,0))
And is works ok.
My question:
any countries where the spelling is slightly different on each spreadsheet,
is there a way to automate the correction process to create an exact match.
For example, to auto correct Bangladesh - Dhaka to Bangladesh-Dhaka (without
the spaces on either side of the hyphen which prevents a match). Or
elimination of leading or trailing spaces which also prevents a match, or
correction of Bangladesh (Dhaka) to Bangladesh-Dhaka to enable a match.
I'm trying to avoid human intervention. There are probably only 5-6
variations (extra spaces; parenthesis to hyphens, etc.) which would have to
be checked and corrected. Is there a macro or something which could
accomplish this?
Or can MATCH be changed so it finds the closest match even if not exact?
Etc.?
hopefully, some or all of the above is possible and can be automated.
appreciate
your help. thanks