Home > Back-end >  How to compare duplicate columns and compare their range of number values to check and return for an
How to compare duplicate columns and compare their range of number values to check and return for an

Time:02-17

this is an extended question to the previous question I asked here : enter image description here

err in case any page for this course is seen in more than 2 places. For example page 1 for English.

Here's the formula:

={
  "Warning";
  ARRAYFORMULA(
    IFS(
      C3:C = "",,
      D3:D = "",,
      IFNA(
      REGEXMATCH(
        TO_TEXT(D3:D),
          "(?:^|,)"
        & VLOOKUP(
            C3:C,
            SPLIT(
              REGEXREPLACE(
                TRANSPOSE(QUERY(
                  QUERY(
                    QUERY(
                      QUERY(
                        SPLIT(
                          FLATTEN(
                            FILTER(C3:C & "♦'♥" & SPLIT(D3:D, ",") & "|", C3:C <> "", D3:D <> "")
                          ),
                          "♥"
                        ),
                        "SELECT Col1, Col2, COUNT(Col2)
                         WHERE Col2 != '|'
                         GROUP BY Col1, Col2",
                      ),
                      "SELECT Col1, Col2
                       WHERE Col3 > 1",
                      1
                    ),
                    "SELECT MAX(Col2)
                     GROUP BY Col2
                     PIVOT Col1",
                  ),,
                  10^7
                )),
                "\|\s*$|(♦'|\|)\s*",
                "$1"
              ),
              "♦"
            ),
            2,
          )
        & "(?:,|$)"
      ), False),
        "err",
      True,
    )
  )
}
  • Related