I'm trying to find a way in Google Sheets to get unique combinations of a given set of strings with the following restrictions:
- given data is set of strings
- one input set per row with up to 17 "types" (1 string per column)
- desired output: all combinations per row with 1, 2, 3, and 4 types
- no repetition within one input set wanted, i.e. "a,b,c" also covers "a,c,b", "b,a,c", etc., but repetitions in different rows are needed
- input strings might contain spaces
- (optional:) output should be sorted alphanumerically (overall or within each group of 1, 2, 3, and 4 elements, respectively)
Example sheet with given data and desired output (created manually): https://docs.google.com/spreadsheets/d/1n-RBtIGJmjVWCSBENX8OrHuqZ4PCGxCnx-gJFhZxsfw/edit?usp=sharing
Desired output example (highlighting just for clarification):
I've read similar questions and solutions like this one: https://sheetswithmaxmakhrov.wordpress.com/2017/12/22/generate-all-possible-combinations-for-columns-in-google-spreadsheets/
But they usually combine data from different columns instead from within a row. The solutions differ quite a lot and use different functions (JOIN, CONCATENATE, TRIM, SEQUENCE, REPT, etc.). This does make it quite hard to understand when reading through the different questions.