Forum Discussion
Steiny88
Jun 01, 2022Copper Contributor
How to get the unique data from 1 column using the duplicates from another column
Hi All, I've been trying to highlight somehow the data in 1 row using the duplicates from another. The example is I have duplicate numbers in column B but in Column A I have 2 different names for ...
- Jun 01, 2022
PeterBartholomew1
Jun 01, 2022Silver Contributor
This is larger and somewhat more rambling approach to the problem!
What I set our to do was, first get a list of distinct numbers. From those return a list of distinct names corresponding to each number. Return any for which there exists more than one match. My assessment is that it is a computationally expensive process so I am not convinced it would extend to tens of thousands of rows. The worksheet formula is
= LET(
distinct, UNIQUE(Number),
matches, MAP(distinct, MultipleMatchesλ),
FILTER(HSTACK(distinct, matches), matches<>"")
)
with a Lambda function MultipleMatchesλ
= LAMBDA(num,
LET(
matchedNames, UNIQUE(FILTER(Name, Number=num)),
multiple?, COUNTA(matchedNames)>1,
IF(multiple?, TEXTJOIN(", ",,matchedNames),"")
)
)