Forum Discussion

subbucat's avatar
subbucat
Copper Contributor
Jul 17, 2023

Duplicate values with partial matches

Hello Gurus,

 

i have an excel sheet with 3000 rows with column A named countries and another column B named cities. I need to highlight the duplicate city names in column B for each country in column A and sort the data to show duplicates one after another. The city names have the same cell values but have additional information in parenthesis, and this is proving to be tougher to highlight the duplicates as excel is treating them as unique values. Below is the sample data. I would greatly appreciate if you could help me with a solution.

 

AFGAlotau
AFGBamiyan (Silk Road)
AFGElsewhere
AFGHerat & Jalalabad
AFGKabul
AFGKabul (Gandarmack and Intercontinental)
AFGKabul (Kabul Serena)
AFGKandahar & Mazar e Sharif
      • subbucat 

        If above doesn't work you may try

        =SUMPRODUCT(--(TRIM(  IFERROR( LEFT($C$3:$C$10, SEARCH("(",$C$3:$C$10)-1 ), $C$3:$C$10) ) = TRIM(  IFERROR( LEFT($C3, SEARCH("(",$C3)-1 ), $C3) ) ) ) > 1

Resources