Detección de duplicados potenciales, con 3 niveles de gravedad

Quiero hacer un programa que detecte posibles duplicados con 3 niveles de gravedad. Consideremos que mis datos están solo en dos columnas, pero con miles de filas. Datos en la segunda columna delimitados solo con coma. Ejemplo de datos:

Number | Material
1      | helmet,valros,42
2      | helmet,iron,knight
3      | valros,helmet,42
4      | knight,helmet
5      | valros,helmet,42
6      | plain,helmet
7      | helmet, leather

y mis 3 niveles son:

muy alto : A B Cvs A B C

alto : A B Cvs B, C, A

regular : A B Cvs A, B

Hasta ahora solo puedo hacer el primer nivel, no sé cómo hacer el segundo y el tercer nivel.

lo que he intentado

Sub duplicates_separation()

    Dim duplicate(), i As Long
    Dim delrange As Range, cell As Long
    Dim shtIn As Worksheet, shtOut As Worksheet



     Set shtIn = ThisWorkbook.Sheets("input")
    Set shtOut = ThisWorkbook.Sheets("output")

    x = 2
    y = 1

    Set delrange = shtIn.Range("b1:b10000")  'set your range here

   ReDim duplicate(0)
'search duplicates in 2nd column
    For cell = 1 To delrange.Cells.Count
        If Application.CountIf(delrange, delrange(cell)) > 1 Then
            ReDim Preserve duplicate(i)
            duplicate(i) = delrange(cell).Address
            i = i + 1
        End If
    Next


        'print duplicates
    For i = UBound(duplicate) To LBound(duplicate) Step -1
    shtOut.Cells(x, 1).EntireRow.Value = shtIn.Range(duplicate(i)).EntireRow.Value


End Sub

Duplicados detectados por el programa:

3      | valros,helmet,42
 5      | valros,helmet,42

lo que esperaba:

Number | Material
1      | helmet,valros,42
3      | valros,helmet,42
5      | valros,helmet,42
4      | knight,helmet
2      | helmet,iron,knight        

Tengo una idea para detectar duplicados lv 2, pero creo que será muy complicado y hará que el programa sea lento.

gire la columna 2 a las columnas con el comando "texto a columnas"ordenar la columna de la A a la Z (alfabéticamente)concatenar la columnaHaga countif como hecho en la detección de duplicados lv 1

¿Hay alguna forma de detectar los duplicados de 2º y 3º nivel?

ACTUALIZAR

Ayer fui a la casa de un amigo para consultar sobre este problema, pero su solución está en lenguaje JAVA ...> lo cual no entiendo

public class ali {

    static void sPrint(String[] Printed) {
        for (int iC = 0; iC < Printed.length; iC++) {
            System.out.print(String.valueOf(Printed[iC]) + " | ");
        }
        System.out.println();
    }

    public static void main(String Args[]) {
        int defaultLength = 10;
        int indexID = 0;
        int indexDesc = 1;
        String[] DETECTORP1 = new String[defaultLength];
        String[] DETECTORP2 = new String[defaultLength];
        String[] DETECTORP3 = new String[defaultLength];
        String[] DETECTORP4 = new String[defaultLength];
        String[][] theString = new String[5][2];
        theString[0] = new String[]{"1", "A, B, C, D"};
        theString[1] = new String[]{"2", "A, B, C, D"};
        theString[2] = new String[]{"3", "A, B, C, D, E"};
        theString[3] = new String[]{"4", "A, B, D, C, E"};
        theString[4] = new String[]{"5", "A, B, D, C, E, F"};
        int P1 = 0;
        int P2 = 0;
        int P3 = 0;
        int P4 = 0;
        for (int iC = 0; iC < theString.length; iC++) {
            System.out.println(theString[iC][indexID] + " -> " + theString[iC][indexDesc]);
        }
        for (int iC = 0; iC < theString.length; iC++) {
            int LEX;
            String theReference[] = theString[iC][indexDesc].replace(",", ";;").split(";;");
            for (int iD = 0; iD < theString.length; iD++) {
                if (iC != iD) {
                    String theCompare[] = theString[iD][1].replace(",", ";;").split(";;");
                    if (theReference.length == theCompare.length) {
                        LEX=0;
                        int theLength = theReference.length;
                        for (int iE = 0; iE < theLength; iE++) {
                            if (theReference[iE].equals(theCompare[iE])) {
                                LEX += 1;
                            }
                        }
                        if (LEX == theLength) {
                            DETECTORP1[P1] = theString[iC][indexID] + " WITH " + theString[iD][indexID];
                            P1 += 1;
                        } else {
                            LEX = 0;
                            for (int iF = 0; iF < theReference.length; iF++) {
                                for (int iG = 0; iG < theCompare.length; iG++) {
                                    if (theReference[iF].equals(theCompare[iG])) {
                                        LEX += 1;
                                        break;
                                    }
                                }
                            }
                            if (LEX == theReference.length) {
                                DETECTORP2[P2] = theString[iC][indexID] + " WITH " + theString[iD][indexID];
                                P2 += 1;
                            }

                        }

                    } else {
                        LEX = 0;
                        if (theReference.length > theCompare.length) {
                            for (int iF = 0; iF < theReference.length; iF++) {
                                for (int iG = 0; iG < theCompare.length; iG++) {
                                    if (iG == iF) {
                                        if (theReference[iF].equals(theCompare[iF])) {
                                            LEX += 1;
                                            break;
                                        }
                                    }
                                }
                            }
                            if (LEX <= theReference.length && LEX >= theCompare.length) {
                                DETECTORP3[P3] = theString[iC][indexID] + " WITH " + theString[iD][indexID];
                                P3 += 1;
                            }
                        } else {
                            LEX =0;
                            for (int iF = 0; iF < theCompare.length; iF++) {
                                for (int iG = 0; iG < theReference.length; iG++) {
                                    if (iG == iF) {
                                        if (theCompare[iF].equals(theReference[iF])) {
                                            LEX += 1;
                                        //    System.out.println(theReference[iG] + "==" + theCompare[iG]);
                                            break;
                                        }
                                    }
                                }
                            }
                            if (LEX <= theCompare.length && LEX >= theReference.length) {
                                DETECTORP3[P3] = theString[iC][indexID] + " WITH " + theString[iD][indexID];
                                P3 += 1;
                            }
                        }

                    }
                }

            }

        }
        sPrint(DETECTORP1);
        sPrint(DETECTORP2);
        sPrint(DETECTORP3);
    }
}

¿Cómo hacer esto en VBA?

Respuestas a la pregunta(1)

Su respuesta a la pregunta