Search code examples
google-sheetsuniquegoogle-sheets-formula

Identify unique mappings among two columns


I have a Google Sheets where there are multiple many-to-one mappings like so:

Col1    Col2
abc     123
abc     123
def     456
pqr     123
xyz     789

How do I separate out only the unique mappings here?

That is, I want the following result:

Col1    Col2
abc     123
def     456
pqr     123
xyz     789

Solution

  • What about

    =unique(A1:B4)
    

    where col A holds the names and B the numbers ?

    In case of non-consecutive columns (e.g. col A and C), try:

    =unique({A:A,C:C})
    

    or,depending on your locale:

    =unique({A:A\C:C})