=MOD(SMALL(IF(MMULT(10^MID(TEXT($H$4:$H$21,"00000"),{1,2,3,4,5},1),{1;1;1;1;1})=SUMPRODUCT(10^MID(TEXT($C$3,"00000"),{1,2,3,4,5},1)),ROW($H$4:$H$21)*10^5+$H$4:$H$21),ROW(A1)),10^5)
Public Function SoSanhChuoi(ByVal str1 As String, ByVal str2 As String) As Boolean
Dim i As Long
If Len(str1) <> Len(str2) Then Exit Function
For i = 1 To Len(str1)
If InStr(1, str2, Mid(str1, i, 1)) = 0 Then Exit Function
str2 = Replace(str2, Mid(str1, i, 1), "", 1, 1)
Next i
SoSanhChuoi = True
End Function