Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is there a quick way to generate a powerset in Excel?
A powerset is the set of all possible combinations of the items in a set. For example, given the set a, b, and c, the powerset is: a b c ab ac bc abc (Technically a powerset also includes the null set, but I'm not concerned about that here.) That's easy enough to do manually with such a small set as this example, but obviously becomes much more tedious and error prone to do manually as the set becomes larger. I could make three column headers in a sheet and enter all three items under all three columns, plus one additional item in each field indicating blank while still being counted as a record (such as the string "blank"), and then do a Cartesian Product on those three fields in MS Query from Excel. But that would return separate records for each possible *sequence* of the same items, such as both ab and ba. For my purposes, ab and ba would effectively be duplicates. FWIW, the reason for this is I have a dropdown where a seller indicates all shipping options they offer, in a comma-separated list, from a list of all approved shipping options. Some sellers might only offer one of the approved shipping options, some two, some all, etc. But the list of all approved options occasionally changes (outside my control), requiring an update of the dropdown list. A list made from a Cartesian Product would be a huge number of dropdown items (and therefore annoying for sellers to use) comared to a powerset. Any thoughts? Thanks, Greg |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I did a search for "vba powerset" and this was the first hit:
http://www.tushar-mehta.com/excel/tips/powerset.html --JP On Oct 26, 11:30*am, Greg Lovern wrote: Is there a quick way to generate a powerset in Excel? A powerset is the set of all possible combinations of the items in a set. For example, given the set a, b, and c, the powerset is: a b c ab ac bc abc -- snip -- |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
There's nothing like posting a question to a newsgroup for thinking of
other ideas for solving a problem. After posting this, it occurred to me to search for a web powerset calcuator. In fact there is one: http://www.mathsisfun.com/sets/power-set-maker.html That will do, at least as long as it is up on the web. But I'd prefer a way to do it in Excel if there is one. Any ideas? Thanks, Greg On Oct 26, 8:30*am, Greg Lovern wrote: Is there a quick way to generate a powerset in Excel? A powerset is the set of all possible combinations of the items in a set. For example, given the set a, b, and c, the powerset is: a b c ab ac bc abc (Technically a powerset also includes the null set, but I'm not concerned about that here.) That's easy enough to do manually with such a small set as this example, but obviously becomes much more tedious and error prone to do manually as the set becomes larger. I could make three column headers in a sheet and enter all three items under all three columns, plus one additional item in each field indicating blank while still being counted as a record (such as the string "blank"), and then do a Cartesian Product on those three fields in MS Query from Excel. But that would return separate records for each possible *sequence* of the same items, such as both ab and ba. For my purposes, ab and ba would effectively be duplicates. FWIW, the reason for this is I have a dropdown where a seller indicates all shipping options they offer, in a comma-separated list, from a list of all approved shipping options. Some sellers might only offer one of the approved shipping options, some two, some all, etc. But the list of all approved options occasionally changes (outside my control), requiring an update of the dropdown list. A list made from a Cartesian Product would be a huge number of dropdown items (and therefore annoying for sellers to use) comared to a powerset. Any thoughts? Thanks, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To generate Numbers in Excel | Excel Worksheet Functions | |||
Using Excel to generate schedules | Excel Discussion (Misc queries) | |||
How can I generate UPC"S through excel? | Charts and Charting in Excel | |||
generate a random number and use if function to generate new data | Excel Worksheet Functions | |||
can i use excel to generate web links | Excel Discussion (Misc queries) |