Array Transformation functions

COLUMN_DUPLICATES

Reference

» N/A

About

Checks for whether there are any duplicate numbers in a vector.

Inputs:

- col_vector: column vector to scan, to find out if there are any duplicates in it.

Code

M.S. Excel
COLUMN_DUPLICATES = LAMBDA(col_vector,
    LET(
        count, SCAN(0, col_vector, LAMBDA(a, r, SUM(--(r = col_vector)))),
        duplicates, IF(
            IFERROR(ROWS(UNIQUE(FILTER(col_vector, count > 1))), 0) = 0,
            "No Duplicates",
            UNIQUE(FILTER(col_vector, count > 1))
        ),
        duplicates
    )
);