Find combinations that appears the most

Hello!

i have a question that i have been looking for quite lot of time and still no answer.
what if i have rows of data and i want to find similar combinations.
for exsample:

black, green, red, purple purple, red, white, blue brown, golden, red, purple orange, light blue, grey, yellow

the combinations that appears the most “red, purple” and it appears 3 times out of 4

is it possible to make such formula?

  • LibreOffice 3.5.7.2, english, Calc, Ubuntu 12.04 LTS

Are you talking about background colours or colour name words in the cells?

color names. they can be as well fuits or animals

I would look into the conditions of each color and use the if function with according conditions.

i think i have to add that possible combinations that there can be is so many it would take weeks to write with all the if´s one by one
there is 50 different colors and every line has 6 colors but with fact that every color can be once every line that´s makes over 15 000 000 different combinations