Question about using the IF function to display matching text/pattern matching

mikelopez

Board Regular
Joined
Sep 9, 2013
Messages
58
Hello everyone.

I just a have a general question about using the IF function to display matching names.

My spreadsheet looks like this

edcoronado
edcoronado123
joeljoelsmith
don schmitdonschimt4523
dansmithdan jones
The above is in the A and B cells respectively.

What I want to know is what would be the proper syntax formula I would use if I wanted to match and display the names that are similar to each other?

What I am trying to create and accomplish is a formula using the IF function where if the name in A1 is similar or the exact name in B1,( as well as A2 and B2 respectively) I want the function to grab the text that is similar and display it in column D. I think I can use the IF function but I am not sure.

Any help would be greatly appreciated. THE FORMULA I AM TRYING TO USE IS
=IF(A1=B1, " ", "9999"

Where if the letters are similar I want the text that is similar to be displayed and if it is not, I want 9999 to appear.

Again any help would be greatly appreciated.

<tbody>
</tbody>
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Okay I will as soon as possible. I just need to find it first. I think i may have found the resolution to my problem but I am not sure. I will get back to you as soon as possible so I can get your input. Thank you so much for your help. I appreciate it.
 
Upvote 0
Here is my sample data as well as the formulas that I used.

I worked on two spreadsheets using different formulas

Here is what is on Sheet1:

edcoronadoedcoronado1234edcoronado
michaellopezmichaellopezmichaellopez
joeljoelsmithjoel
donschmitdonschmit4523donschmit
janet smithjanetsmith222janetsmith
dan smithdansmithdansmith
johnsmith1882johnsmithjohnsmith
eddiejohnson231eddiejohnsoneddiejohnson
laurenconleylaurenconley08laurenconley
joann ordelljoann ordelljoannordell
joansmithjoan smthjoansmith
jake tylerjohn tyler9999
ben gordonben gordonbengordon
nick tomson321nicktomsonnicktomson

<tbody>
</tbody>

I used the following formulas to find this data:
=IF(FuzzyPercent(A1,B1,4)>50%,A1,9999) (I used this formula to find the text data if there is text in the first cell name within the cell and if there is a name plus number in the second cell.)
=IF(FuzzyPercent(B7,A7,4)>50%,B7,9999) (I used this formula to find the text data if there is a number in the name in Cell A8 or the first cell.)
=SUBSTITUTE(A11, " ","") (I used this formula to help me find the same text if it is separated by spaces in either on or both cells.)

This includes the output.

This is the first sheet. In my next post I will post the second sheet.
 
Upvote 0
Here is what I used for Sheet 2.

edcoronadoedcoronado1234edcoronado
michael lopezmichaellopezmichaellopez
joeljoelsmithjoel
donschmitdonschmit4523donschmit
janetsmithjanetsmith222janetsmith
dansmithdansmithdansmith
johnsmith1882johnsmithjohnsmith
eddiejohnson231eddiejohnsoneddiejohnson
laurenconleylaurenconley08laurenconley
nick tomson321nicktomsonnicktomson
ben gordonben gordonbengordon
jake tylerjohn tyler9999

<tbody>
</tbody>

=IF(NOT(ISERROR(SEARCH("*"&A1&"*",B1))), A1, "9999")
(I used this formula to find the text data if there is text in the first cell name within the cell and if there is a name plus number in the second cell.)

=IF(NOT(ISERROR(SEARCH("*"&B7&"*",A7))), B7, "")
(I used this formula to find the text data if there is a number in the name in Cell A8 or the first cell.)

=SUBSTITUTE(A12, " ","")
(I used this formula to help me find the same text if it is separated by spaces in either on or both cells.)

=IF(NOT(ISERROR(SEARCH("*"&A14&"*",B14))), A14, "9999")
(I put 9999 in quotation marks to have the user see those numbers if the names don't match.

I like the formulas that I used but do you think there is a universal formula that I could use that would do all of these functions above without having me to switch between A and B in the cell placement on the formula?

If you don't know, that's okay. I understand. I greatly appreciate your help. Thank you again. What do you think?
 
Last edited:
Upvote 0
One more thing I forgot to mention, I reduced the security for macros to low in excel 2003 so that I could use that FUZZYLOOKUP function.
 
Upvote 0
You are better off using a macro, hopefully someone can come up with what you want. Also check out AND and OR functions. good luck.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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
Back
Top