Cross-posted at https://www.mrexcel.com/board/thread...-cell.1191127/ with solution
Hi, I am new here.
I have a list of different numbers in range A1:A18
What i need is to sum up any 3 or 4 values that can be near to 240 but not more than that
For Example, I have This List
Range A1 to A18 (Largest to Smallest)
A1: 87
A2: 86
A3: 85
A4: 84
A5: 83
A6: 82
A7: 81
A8: 81
A9: 72
A10: 70
A11: 69
A12: 66
A13: 63
A14: 59
A15: 57
A16: 54
A17: 53
A18: 50
Now i need Any Combination of 3 values or 4 values which sums the maximum number but the total always be less than 240.
Like in Above List The Possible Combinations to make Totals which should be less than 240 is below.
85 + 84 + 70 = 239
83 + 82 + 72 = 237
81 + 81 + 69 = 231
63 + 59 + 57 + 54 = 233
53 + 50 = 103
It should give me the totals Like That but not more than 240
and the cells which are used should not be used again like in the first combination Cell A3 (i.e. 85) , A4 (84), and A10 (70) is used so it should not be used again.
if there is any macro any brother can help for this.
Thanks for your support in advance.
Bookmarks