I'm analyzing sales data in an Excel report. Each row represents a product sold.
ticket product
20190101203045 Eggs
20190101203045 Pancakes
20190101203045 Happy meal
20190101203045 Coca-Cola
20190101203045 Orange juice
20190102144525 All-Bran cereal
20190102144525 Fruit
20190102144526 Lemonade
I have successfully concatenated all products with the same ticket # and separated them into columns:
20190101203045,Eggs,Pancakes,Happy meal,Coca-Cola,Orange juice
20190102144525,All-Bran cereal,Fruit
20190102144526,Lemonade
To test for unique combinations (no particular order) I used a simple and effective approach, assign a power of 2 (1,2,4,8,16,...) number to every individual value (eggs, pancakes, happy meal, ...) so that every unique combination results in a unique value when adding up their assigned values, example:
20190101203045,1,2,4,8,16 = 31 (only this combination will result in 31)
20190102144525,32,64 = 96 (only this combination will result in 96)
20190102144526,128 = 128 (only this combination will result in 128)
This works very well with a small number of values, I would just SUM these values and search for duplicates, but the files I'm analyzing may have up to 2000 different values (products), so this approach no longer works (numbers get BIG).
There are other approaches like using formulas, but the sheets have thousands of rows (too much processing), so I'm looking for a more creative, efficient solution.
Any help is appreciated
20190101203045,Eggs,Pancakes,Happy meal,Coca-Cola,Orange juicedoes not look as if the product list is sorted. - Ron Rosenfeld