Match 2 names EXACLY

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
2 columns contains names which I am trying to MATCH EXACTLY & get the result "MATCHED" or "NOT MATCHED" in another column.
Rule: First 7 alphabets & last 5 alphabets should MATCH EXACTLY.
Ex:
C3=AAABBBCCCDDDEEEFFFGGG
D3=AAABBBCZZZZFFGGG
E3=MATCHED
In above example: if D3=AAaBBBCZZZZFFGGG, E3="NOT MATCHED"

How to accomplish?
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254
Hi

In E3:
=IF(AND(EXACT(LEFT(C3,7),LEFT(D3,7)),EXACT(RIGHT(C3,5),RIGHT(D3,5))),"MATCHED","NOT MATCHED")

Vidar
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
Vidar,

If C3=AFFGGG
If D3=AFFGGG, will it take care?
 

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254
Hi
It will only work for text strings you specified in your first post.
If you have other text string patterns, then you should list them up together with the results you seek.

Vidar
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows

ADVERTISEMENT

What to do then? C3 & D3 can have MINIMUM 1 alphabets to MAXIMUM 200 alphabets.
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,712
Office Version
  1. 2010
Platform
  1. Windows
What to do then? C3 & D3 can have MINIMUM 1 alphabets to MAXIMUM 200 alphabets.

Explain to us, in detail, how your matching rule works when there are less than 12 characters.
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
959
Office Version
  1. 2007
Platform
  1. Windows
C3=ABCDEFGHI
D3=ABCDEFFFFFFFEFGHI
Rule: FIRST 7 alphabets & LAST 5 alphabets should MATCH EXACTLY.
For C3, FIRST 7=ABCDEFG & LAST 5=EFGHI
For D3, FIRST 7=ABCDEF & LAST 5=EFGHI
So answer=MATCHED
If D3 would have been=ABCDEFGEFGH
For D3, FIRST 7=ABCDEF & LAST 5=GEFGH
So answer=NOT MATCHED
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,712
Office Version
  1. 2010
Platform
  1. Windows
I think this might work...

=IF(OR(LEN(C3)<7,LEN(D3)<7),"NOT MATCHED",IF(AND(EXACT(LEFT(C3,7),LEFT(D3,7)),EXACT(RIGHT(C3,5),RIGHT(D3,5))),"MATCHED","NOT MATCHED"))
 

Watch MrExcel Video

Forum statistics

Threads
1,123,310
Messages
5,600,884
Members
414,413
Latest member
Sinbin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top