Find Duplicate Texts among rows using macro

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
205
Office Version
  1. 2019
Platform
  1. Windows
In My sheet there are 2000 names & their Father or husbands names are there in Column A & B.
Column A is the name & Column B is thier father's name or husbands name.
I want to find the duplicate values among the 2000 names. But I cant use the Conditional Formatting - Highlight cell rules - Duplicate values in case of the names because the data entry of the names are not having unique values.
For example Ram father name is Peter, in another row its shown as Rama Father name is Pitter. Is there any solution to Find that If any of the particular row's column A & B's 50% text matches with another Row's Text of Column A & B then it will highlight with a colour then my problem can be solved.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi,

Apart from the name is there any other unique number or ID ? example staff ID, etc. I am just going by the example which you have provided. It looks more like a typo error which can be rectified though another unique ID / NUMBER.
 
Upvote 0
Hi,Apart from the name is there any other unique number or ID ? example staff ID, etc. I am just going by the example which you have provided. It looks more like a typo error which can be rectified though another unique ID / NUMBER.
No there are no unique number is associated with the name. The database is created by data entry by different persons hence if someone wrote Peter then another person wrote Pitter. Now that's difficult to find the duplicate rows.
 
Upvote 0
Then you can try this, you will have to add additional columns, like below. After you drag the formula then filter the header and sort by "NAME1". Should make it easy to identify. If this works probably same logic can be applied for macro

[TABLE="width: 439"]
<tbody>[TR]
[TD="class: xl66, width: 64, bgcolor: #44546A"]NAME
[/TD]
[TD="class: xl66, width: 125, bgcolor: #44546A"]PARENT/HUSBAND
[/TD]
[TD="class: xl66, width: 88, bgcolor: #44546A"]NAME1
[/TD]
[TD="class: xl66, width: 135, bgcolor: #44546A"]PARENT/HUSBAND 1
[/TD]
[TD="class: xl66, width: 173, bgcolor: #44546A"]COUNT
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]PAUL
[/TD]
[TD="class: xl65, bgcolor: transparent"]ROBERT
[/TD]
[TD="class: xl67, bgcolor: transparent"] =LEFT(A12,3)
[/TD]
[TD="class: xl65, bgcolor: transparent"] =LEFT(B12,3)
[/TD]
[TD="class: xl65, bgcolor: transparent"] =COUNTIF($C$12:C12,C12)
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]SHAWN
[/TD]
[TD="class: xl65, bgcolor: transparent"]SIMPSON
[/TD]
[TD="class: xl65, bgcolor: transparent"]SHA
[/TD]
[TD="class: xl65, bgcolor: transparent"]SIM
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]1
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]PAULERS
[/TD]
[TD="class: xl65, bgcolor: transparent"]ROB
[/TD]
[TD="class: xl65, bgcolor: transparent"]PAU
[/TD]
[TD="class: xl65, bgcolor: transparent"]ROB
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]1
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]SHAWNY
[/TD]
[TD="class: xl65, bgcolor: transparent"]SIMP
[/TD]
[TD="class: xl65, bgcolor: transparent"]SHA
[/TD]
[TD="class: xl65, bgcolor: transparent"]SIM
[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]2
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Then you can try this, you will have to add additional columns, like below. After you drag the formula then filter the header and sort by "NAME1". Should make it easy to identify. If this works probably same logic can be applied for macro

[TABLE="width: 439"]
<tbody>[TR]
[TD="class: xl66, width: 64, bgcolor: #44546A"]NAME[/TD]
[TD="class: xl66, width: 125, bgcolor: #44546A"]PARENT/HUSBAND[/TD]
[TD="class: xl66, width: 88, bgcolor: #44546A"]NAME1[/TD]
[TD="class: xl66, width: 135, bgcolor: #44546A"]PARENT/HUSBAND 1[/TD]
[TD="class: xl66, width: 173, bgcolor: #44546A"]COUNT[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]PAUL[/TD]
[TD="class: xl65, bgcolor: transparent"]ROBERT[/TD]
[TD="class: xl67, bgcolor: transparent"] =LEFT(A12,3)[/TD]
[TD="class: xl65, bgcolor: transparent"] =LEFT(B12,3)[/TD]
[TD="class: xl65, bgcolor: transparent"] =COUNTIF($C$12:C12,C12)[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]SHAWN[/TD]
[TD="class: xl65, bgcolor: transparent"]SIMPSON[/TD]
[TD="class: xl65, bgcolor: transparent"]SHA[/TD]
[TD="class: xl65, bgcolor: transparent"]SIM[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]PAULERS[/TD]
[TD="class: xl65, bgcolor: transparent"]ROB[/TD]
[TD="class: xl65, bgcolor: transparent"]PAU[/TD]
[TD="class: xl65, bgcolor: transparent"]ROB[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]SHAWNY[/TD]
[TD="class: xl65, bgcolor: transparent"]SIMP[/TD]
[TD="class: xl65, bgcolor: transparent"]SHA[/TD]
[TD="class: xl65, bgcolor: transparent"]SIM[/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]

Thanks for the idea, but sorry this will not work for me because the first 3 letters of name also doesn't match in many of my database my database is full of errors such as names are Robert Rubert Rubbertt Ruubert Robort, hence this will not work.
 
Upvote 0
Upvote 0
Hi,

The formula (fuzzypercent) is not an array formula, so you need to compare A1&B1 (PAUL ROBERTS) to the rest of the lines...

C2 =fuzzypercent($A$1&$B$1,A2&B2,3)


[TABLE="width: 296"]
<colgroup><col span="2"><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]PAUL[/TD]
[TD]ROBERT[/TD]
[TD]Percent[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]SHAWN[/TD]
[TD]SIMPSON[/TD]
[TD]1.61%[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]PAULERS[/TD]
[TD]ROB[/TD]
[TD]44.44%[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]SHAWNY[/TD]
[TD]SIMP[/TD]
[TD]3.70%[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]PooL[/TD]
[TD]ROBaRT[/TD]
[TD]37.04%[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]PAUL[/TD]
[TD]ROBERT[/TD]
[TD]100.00%[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]PAULERS[/TD]
[TD]ROB[/TD]
[TD]44.44%[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]SHAWNY[/TD]
[TD]SIMP[/TD]
[TD]3.70%[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

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