List combinations with parameters?

julios

New Member
Joined
Dec 23, 2010
Messages
18
Hi all. I am new both here and in excel. I did a quick search, but couldn't find what i was looking for (possibly cause i wouldn't recognize it even if i saw it:stickouttounge:). I have a problem and i need to ask if it is possible to solve through excel.

I have 3 categories of numbers say in 3 columns of a worksheet. For example category A has the numbers 73, 31, 55, 68. Category B 59, 57, 21, 35, 72, 65, 44, 58, 32, 33 and category C 72, 21, 37, 48, 68, 70, 49, 26, 41, 85.

I need to make combinations of 10, yes i know they would be a lot, so i want to include some parameters that will make the results fewer.

For example every 10-numbered combination should get only 2 numbers of category A, 4 numbers of category B and another 4 from category C.

The sum of each combination when the numbers are added should be no more than 500.

Is it possible for excel to generate and display all possible combinations given the above parameters??

If there is a solution and since I'm a newbie, please explain as if to an ape:biggrin:.

Thank you very much in advance.
 
("pleasantly surprised" - that was for julios)
Dense, sorry!
The Art of Computer Programming - that's were I've seen the name
The series is a treasure. I bought the first three volumes in the mid 70's (!) and still read them. Vol 4 is out in partially completed sections (Knuth calls 'em "fascicles"), and the combinational algorithm was drawn from section 3, Generating all Combinations and Partitions. The volume is available in five soft-cover books (numbered 0 to 4 :laugh:) from Amazon (http://www.amazon.com/Art-Computer-...=sr_1_3?s=books&ie=UTF8&qid=1293463112&sr=1-3)
 
Last edited:
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I removed the errant reference and reposted -- same link.
 
Upvote 0
Don't ever set your security level to Low. Set it to disable macros with notifications, then enable the content if you both trust the source and need to enable macros.

When you get the message, what's the line of code is highlighted?

From the VBE (the place where you can see the code) do Tools > References, and see if one of the ticked boxes (they are all at the top of the dialog) starts with "MISSING". If so, untick the reference and try again.

I set my security to medium and clicked "enable macros" upon starting excel.
The code highlighted is the one xenou posted


wksOut.Rows(nOut + 1).Resize(, 2).Value = Array(dSum, Left(sOut, Len(sOut) - 1))



Did xenou's solution, but unfortunately it changed nothing, I still get the exact same popups.

In VBE the "references" option is not available (not highlighted or clickable).

I am thinking it is possibly due to my version of excel (2003:confused:).

I got that "pleasantly surprised" was directed to me as I was pleasantly surprised myself:laugh:


edit: redownloaded now and works like a charm. thank you both so much for the time and effort.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,766
Messages
6,174,373
Members
452,560
Latest member
Turbos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top