Combining three columns in google spreadsheets into one with no duplicates

StackOverflow https://stackoverflow.com/questions/23318973

  •  10-07-2023
  •  | 
  •  

سؤال

I have three columns containing different breeds of dogs (the list is much more extensive):

Border Collie           Beagle       German Shepard
Australian Sheepdog     Husky        Australian Sheepdog

I want the result to be just the list of the breeds in one column (in a new sheet), without duplicates:

Border Collie
Australian Sheepdog
Beagle
Husky
German Shepard

I have tried =UNIQUE(DogBreeds_) but it gives them in three columns still. DogBreeds_ being the macro for the three columns of all the breeds.

Thank you for your help

هل كانت مفيدة؟

المحلول

Try this:

=unique(transpose(split(join(";",A1:A2,B1:B2,C1:C2),";")))

Assuming that your data is in the first two rows of the columns A,B,C

I'm sure that there must be a prettier solution, but that's the only one that came to my mind. Actually, this seems a duplicate to this problem: Stacking multiple columns on to one?

Hope it helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top