PDA

View Full Version : Combinations



ska67can
12-09-2006, 09:17 PM
Hey Everyone.
First post, new to the forum, have learned a lot reading other posts.
Have a math problem.

Let's say I have 4 Ranges. In each range I have 2 numbers.

I need to iterate thru these ranges and fin the highest value for the 2nd as long as the 1st is 50 or less.
Here is the twist; I need 1 value from the 1st range, 2 values from the 2nd range 3 from the 3rd range and 4 from the 4 th range.
Any bored geniuses out there?

lucas
12-09-2006, 09:30 PM
Sounds like an assignment....?

ska67can
12-09-2006, 09:33 PM
No, a hockey pool.

lucas
12-09-2006, 09:44 PM
I'm a little confused about this part:


In each range I have 2 numbers.

Here is the twist; I need 1 value from the 1st range, 2 values from the 2nd range 3 from the 3rd range and 4 from the 4 th range.


how do we do that if there are only 2 numbers in each range?

Could you post a workbook with 2 sheets. one with before and one after so we could get an idea of what your trying to do?

ska67can
12-09-2006, 10:07 PM
you misunderstood me. There are 2 values that are important. Here is the file. I need to find the highest value of column H while ensure column G is <= 50.

The twist is I need:
2 from Range(A6:A122)
4 from Range(A131:A309)
3 from Range (A313:A453)
1 from Range (A457:A516)

mdmackillop
12-10-2006, 02:05 AM
Hi Ska,
Welcome to VBAX
Sorry to say trhat you've completely lost me. There are only names in column A. The highest value in G is 6.167. You also say something about "finding the highest values". What is to be done with them?
Could you please restate your question with reference to your posted workbook stating exactly what you're after.
Regards
MD

ska67can
12-10-2006, 07:28 AM
Hi MD,

Thanks for replying. Lets see if I can make this clear.

Let's call Range(A6:H122) a, Range(A131:H309) b, Range(A313:H453) c, and Range(A457:H516) d.

I need to find the highest possible result for:

G(a) + G(a) + G(b) + G(b) + G(b) + G(b) + G(c) + G(c) + G(c) + G(d)
while
H(a) + H(a) + H(b) + H(b) + H(b) + H(b) + H(c) + H(c) + H(c) + H(d) < 0

I need to know which cells were used to obtain the best result. Hope this clears it up.

ska

mdmackillop
12-10-2006, 08:37 AM
while
H(a) + H(a) + H(b) + H(b) + H(b) + H(b) + H(c) + H(c) + H(c) + H(d) < 0
What does this mean?

ska67can
12-10-2006, 11:31 AM
sorry. Meant <50