Advanced Conditional Formatting: If Any Word GREATER than 1 Character in a cell, can be found within another cell.

jeffcoleky

Active Member
Joined
May 24, 2011
Messages
274
I can't wrap my brain around this scenario to come up with something.

Spelled out this is what I would like conditional formatting to do: Highlight a row if ANY word in A2 greater than 1 character, can be found within cell B2.

Why we need it:
We're trying to quickly identify which names in Columns A & B don't match up, that's all.


  • The reason we want any word 2 characters or more, is because we don't want to match middle initials.
  • The reason we are OK with matchin ANY word in column "A" and not just the first or last names is because if the person was married, divorced, etc. then their last name could be different (eg. Pat Smith -> Pat Jones) but they're still the same person. If they go by a shortened name (Patrick -> Pat) in one column and not the other, then we still want it to match. This won't be an exact science though because if a female divorces and goes by a shortened first name AND changes her last name, it won't find her (EG. Patricia Smith -> Pat Jones), but that's OK.

Does this make sense?

Here is my sample data:

Excel 2010
ABC
1Seaches These wordsWithin Same Row of this ColumnExists (Manual Result)
2PAT SMITHPATRICIA SMITH; EDDINGTON, BETSY; CAPITAL ONE BANK; AMERICAN GENERAL FINANCIAL SER, VICES INC; AMERICAN GENERAL FINANCE; SEARS ROEBUCK & CO; NATIONAL CITY BANK INDIANA; TERRAS FUNDING INC; TERRAS FUNDING LLC; COUNTY LINE INVESTMENTS LLCYes
3PAT JONESPATRICIA SMITH; EDDINGTON, BETSY; CAPITAL ONE BANK; AMERICAN GENERAL FINANCIAL SER, VICES INC; AMERICAN GENERAL FINANCE; SEARS ROEBUCK & CO; NATIONAL CITY BANK INDIANA; TERRAS FUNDING INC; TERRAS FUNDING LLC; COUNTY LINE INVESTMENTS LLCNo
4PATRICIA SMITHPATRICIA SMITH; EDDINGTON, BETSY; CAPITAL ONE BANK; AMERICAN GENERAL FINANCIAL SER, VICES INC; AMERICAN GENERAL FINANCE; SEARS ROEBUCK & CO; NATIONAL CITY BANK INDIANA; TERRAS FUNDING INC; TERRAS FUNDING LLC; COUNTY LINE INVESTMENTS LLCYes
5PATRICIA JONESPATRICIA SMITH; EDDINGTON, BETSY; CAPITAL ONE BANK; AMERICAN GENERAL FINANCIAL SER, VICES INC; AMERICAN GENERAL FINANCE; SEARS ROEBUCK & CO; NATIONAL CITY BANK INDIANA; TERRAS FUNDING INC; TERRAS FUNDING LLC; COUNTY LINE INVESTMENTS LLCYes
6BOB & SARA SMITHSMITHIE, BOBBIE; SMITHIE, JANETNo
7GUELDA tommyGUELDA, TOMMYYes
8MMCCI LLCTORSTRICK, SAMUEL; TORSTRICK, SAMUEL, W; MMCCI LLCYes
9WITTMER Chris J & Sandy JWITTMER, CHRIS, J; WITTMER, SANDY, J; FRANKFORT FRANKLIN COUNTY ME, TRO GOVERNMENTYes
10DOWNIE TONIDOWNIE, TONI; DESOKY, JOE, H; NATIONAL CHECK BUREAU INC; SOUTHERN EMERGENCY MEDICAL SPE, CIALISTS; FAYETTE COUNTY ME, TRO DEPARTMENT OF CO, DES & REGULATIONSYes
11TERRA JONESEDDINGTON, CHRISTIE; CAPITAL ONE BANK; AMERICAN GENERAL FINANCIAL SER, VICES INC; AMERICAN GENERAL FINANCE; SEARS ROEBUCK & CO; NATIONAL CITY BANK KENTUCKY; TERRA FUNDING INC; TERRA FUNDING LLC; COUNTY INVESTMENTS LLCYes
12JEFF TATESTRANGE, JAMES; POORE, JAN; JOE PROPERTIES LLC; SMW LOCAL 110 FEDERAL CREDIT U, NION; HANNIN, GREG, TATE; HANNIN, TATE; SHEFFIELD, DONYes
13HAMPTON Jeff L IIHAMPTON, JEFF, L II; HAMPTON, JEFF; HAMPTON, JEFF, II; CAPITAL ONE BANK USA NA; ECLIPSE BANK INC; FRANKFORT FRANKLIN COUNTY ME, TRO DEPARTMENT OF CO, DES & REGULATIONSYes
14BATTS JanetMASON, JANET; MASON, TONY; MY HEALTHCARE INC; COMMONWEALTH OF INDIANA WORKF, ORCE DEVELOPMENT CAB, INET EX REL DIVISION; FIRST UNION NATIONAL BANK OF N, ORTH CAROLINA; WACHOVIA BANK OF DELAWARE NATI, ONAL ASSN; CHRYSLER FINANCIAL; TD AUTO FINANCE LLCYes
15BRADEN LESLEY MaryBRADEN, LESLEY, MARY; FRANKFORT FRANKLIN COUNTY ME, TRO GOVERNMENTYes
16WILLIAM & ALEXANDRA CRUMS LAND TRUSTSMITH, SHANNON; SMITH, TARISA, LYNETTE FULLER; FULLER, TARISANo

<tbody>
</tbody>
Sheet1

Formatting Constants:

  • The words in Column "A" are ALWAYS separated by spaces or an "&". Never a comma or semicolon
  • The words in Column "B" are ALWAYS separated by a comma or a space. Each name is always separated by a semicolon ";".

I've tried all the ISNUMBER, SEARCH, and FIND variations I can think of... but what I need is more complicated than I can figure out. I'm sure what i need is a complex version of the below formulas:
=ISNUMBER(SEARCH(A2,B2))
=ISNUMBER(FIND(A2,B2))

I'm OK adding a macro or a column to the sheet if needed.

I know how to set the conditional formatting rule up, I just need help with the formula. Anyone?
 
Yes, thank you!

Another way (with formula):

Array formula - use Ctrl+Shift+Enter and not only Enter to enter the formula

Code:
In C2

=IF(COUNT(SEARCH(IF(LEN(TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",LEN(A2))),(ROW($1:$999)-1)*LEN(A2)+1,LEN(A2))))>1,
" "&TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",LEN(A2))),(ROW($1:$999)-1)*LEN(A2)+1,LEN(A2)))&" ")," "&SUBSTITUTE(SUBSTITUTE(B2,";"," "),","," ")&" ")),"Yes","No")

Markmzz
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Thanks for the nice words, but I think that we are all learning here in the fórum.

Markmzz

Absolutely. For me, this has been one of the best ways to improve my Excel knowledge.

Many of the tricks I learned are from your posts.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,603
Members
449,089
Latest member
Motoracer88

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