detect only the initial pair of each of the 4 groups,
note that is only the first two numbers
of each sector, goal is to find the beginning of each of the 4 patterns (groups)
http://www.mediafire.com/file/oaluxfh3bcggs1j/somente__a_dupla_inicial_de_cada_grupo.xlsx/file
Cell Q6=IF(COUNTIF($P6
6,"x")<2,IF(ISNA(MATCH(Q$5,$A6:$O6,0)),"","x"),"") then copy formula across to W6
Cell Y6=IF(COUNTIF($X6:X6,"x")<2,IF(ISNA(MATCH(Y$5,$A6:$O6,0)),"","x"),"") then copy formula across to AC6
Cell AE6=IF(COUNTIF($AD6:AD6,"x")<2,IF(ISNA(MATCH(AE$5,$A6:$O6,0)),"","x"),"") then copy formula across to AL6
Cell AN6=IF(COUNTIF($AM6:AM6,"x")<2,IF(ISNA(MATCH(AN$5,$A6:$O6,0)),"","x"),"") then copy formula across to AR6
Then copy whole range Q6:AR6 down the spreadsheet as far as you need.