Forum Discussion

DianaT's avatar
DianaT
Copper Contributor
Jan 15, 2020
Solved

How to remove duplicates across one row?

Hello all.

 

I have an spreadsheet that looks similar to the below. I'm trying to build a formula for the last column, which counts the number of different names across each row but only counting duplicate once:

 

ID          Name 1        Name 2      Name 3        Name 4   Name 5       Number of name count

1            Kate             Marie                              Marie                          2

2            Fiona           Jo                Alex              Pam        Fiona           5

3            Fiona                                                   Fiona                          1

 

No success so far 😞 Any advice will be greatly appreciated. Thank you.

 

Cheers!

6 Replies

  • DianaT 

    The are some new approaches that are coming available in the new versions of Excel.  Given a list 'names', the formula

    = FILTER( Names, ISTEXT(Names) )

    will remove the blanks from the array.   The function UNIQUE may then be used to give an array of distinct names

    = UNIQUE( FILTER( Names, ISTEXT(Names) ) )

    I used a named formula 'distinctNames' for this, both the simplify the worksheet formula and to allow reuse.  The worksheet formula

    = IF( COUNTA(Names), COUNTA( distinctNames ), "" )

    only perform the count unique if names are present.

     

  • DianaT's avatar
    DianaT
    Copper Contributor
    Happy to do so! But has the forum changed recently? I can only mark "best response" (which I did) but no "mark as solution" button....

Resources