Search code examples
excelconditional-formattingcountif

Conditional Formatting - Highlight only if first numbers are duplicates


ich have found the CountIF formula. But i can't highlight cells if everything is the same except the last digit. For example here should be the cells with GA22515089-X highlighted

enter image description here


Solution

  • Use COUNTIF with the constart part of your strings and combined with wildcards. So count how many rows starts with same string. IF the count is greater than 1, it's a duplicate:

    enter image description here

    Formula:

    =COUNTIF($A$1:$A$16,LEFT(A1,SEARCH("-",A1))&"*")>1