nav2567
asked on
macro to compare 2 Excel columns.
Hello,
I have a spreadsheet with the below layout:
group1 group2
computer 1 computer 5
computer 2 computer 6
computer 3 computer 4
computer 4 computer 1
..... ......
i need a macro to put the work MATCH in column 4 when computers in column 2 appears in column 1. for example:
group1 group2
computer 1 computer 5
computer 2 computer 6
computer 3 computer 4 MATCH
computer 4 computer 1 MATCH
..... ......
Please advise.
Thanks.
I have a spreadsheet with the below layout:
group1 group2
computer 1 computer 5
computer 2 computer 6
computer 3 computer 4
computer 4 computer 1
..... ......
i need a macro to put the work MATCH in column 4 when computers in column 2 appears in column 1. for example:
group1 group2
computer 1 computer 5
computer 2 computer 6
computer 3 computer 4 MATCH
computer 4 computer 1 MATCH
..... ......
Please advise.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
nav2567:
It does work, i have tested it, you just need to adjust the columns / rows to match your sheet
It does work, i have tested it, you just need to adjust the columns / rows to match your sheet
ASKER
Al_XResearch
I am not follow your formula. Do you mind modify it for me?
I have Group 1 in column A. Group 2 in column B. The MATCH will be put in column D - see above again.
Shums,
I tried your formula. I took out an entry in column A but column D still shows MATCH which is not right.
Thanks.
I am not follow your formula. Do you mind modify it for me?
I have Group 1 in column A. Group 2 in column B. The MATCH will be put in column D - see above again.
Shums,
I tried your formula. I took out an entry in column A but column D still shows MATCH which is not right.
Thanks.
Then try below:
=IF(COUNTIF(B:B,A2)>0,"Mat ch","")
=IF(COUNTIF(B:B,A2)>0,"Mat
ASKER
Shums, now, the compare column showing everything is blank instead of 90% match.
Try this:
=IF(ISNUMBER(MATCH(B2,$A:$ A,0)),"Mat ch","")
=IF(ISNUMBER(MATCH(B2,$A:$
ASKER
no good. The first entry in b2 is somewhere in column A. It shows blank in column C.
Test it and you will see.
Test it and you will see.
I did tested, its working see attached...
Screenshot_2017-04-21-03-18-17-625.jpeg
Screenshot_2017-04-21-03-18-17-625.jpeg
ASKER
I have realized I have an extra space right after each name in column B. My bad, my apologies to both of you!!!
Is it possible to remove that extra space after each name in column B?
Is it possible to remove that extra space after each name in column B?
Nav256:
My formula and the version from 'shums' are basically the same (just written slightly differently) - "more than one way to skin an egg"
I have created a workbook that shows both methods working. Please see attached
My formula and the version from 'shums' are basically the same (just written slightly differently) - "more than one way to skin an egg"
I have created a workbook that shows both methods working. Please see attached
ASKER
Sorry, I do not see any attachment.
Is there a way to remove the extra space right after each name in column B?
Is there a way to remove the extra space right after each name in column B?
The only way you could remove the trailing space (or even a preceeding one) would to to add to normally hidden columns in between the current ones as 'helper columns' and use TRIM() on the previous columns value.
So Columns A & C would be the 'Group' data and columns B & D would be the trim formula to remove the preceding or trailing spaces such as B2 formula is '=TRIM(A2)' and then change the 'result' formula in column E (formally D) should be amended to work with columns B & D rather than A and B
So Columns A & C would be the 'Group' data and columns B & D would be the trim formula to remove the preceding or trailing spaces such as B2 formula is '=TRIM(A2)' and then change the 'result' formula in column E (formally D) should be amended to work with columns B & D rather than A and B
ASKER
Group 1 in column A. Group 2 in column B. The MATCH will be put in column D.
thanks.