Excel Functions

G

Guest

Is there a way in Excel to produce results for the following problem:

Let's say I have a pipe to be installed that is 120 ft. long.

There are three lengths of pipe that I can use 8', 6', and 4'. I want to
know ALL of the possibilities for construction.

Example: One solution would be (10) 8' pipes (4) 6' pipes, and (4) 4' pipes.
I want to know ALL of the solutions.

Thanks

Chris

P.S. I know how to find the optimal solution with the solver (ie. lowest
cost) but still need to know all of the possibilities.
 
M

Myrna Larson

There's no built-in way to do it. It would require a macro, and even there you
have a problem. I've written code to generate combinations (which you can find
on Google), but it won't solve this problem because the number of pieces in
the subset isn't fixed. You would have to run it multiple times, with multiple
subset sizes, plus modify the code to not display combinations where the total
length is less than 120.

If you want a better idea of the complexity, you can take a look at my code.
It's several pages long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top