Column A contains texts. Each text has values in the neighboring cells. Now I want to check for each row whether the other rows also contain these values. Restriction: At least three values must match and regardless of the order in the row.
The rows, which belong together because of at least 3 common values, should be grouped. A group name should be assigned to them dynamically.
An example table might look like this:
INPUT
Word | Value01 | Value02 | Value03 | Value04 |
---|---|---|---|---|
banana | A | B | C | D |
sweet banana | L | N | O | J |
cheap banana | B | D | A | F |
best banana | D | C | A | H |
banana banana | N | L | I | O |
how to make banana bread | O | A | I | K |
I love banana | B | C | A | D |
banana bread | I | O | A | C |
EXPECTED OUTPUT
Word | Value01 | Value02 | Value03 | Value04 | group name |
---|---|---|---|---|---|
banana | A | B | C | D | banana group 1 |
sweet banana | L | N | O | J | banana group 2 |
cheap banana | B | D | A | F | banana group 1 |
best banana | D | C | A | H | banana group 1 |
banana banana | N | L | I | O | banana group 2 |
how to make banana bread | O | A | I | K | banana group 3 |
I love banana | B | C | A | D | banana group 1 |
banana bread | I | O | A | C | banana group 3 |
I tried the following formula:
=ArrayFormula(IF(B1:E1=B1:E8,"banana group 1","banana group 2"))
But the problems are, only the exact match is recognized and I am limited to two group names. Here is a link to the example table: Example Table