shersalafi
New Member
- Joined
- Dec 24, 2021
- Messages
- 4
- Office Version
- 365
- 2010
- Platform
- Windows
Hi, to every one.
I am creating a report. i have a list of different numbers in range M4:M21
What i need is to sum up any 3 or 4 values that can near to 240 but not more than that
For Example I have This List
Range M4 to M21
Now i need Any Combination of 3 values or 4 values which sums the maximum number but should be less than 240.
Like in Above List 86 + 84 + 69 = 239
Then 63 + 82 + 87 = 232
It should give me Like That but not more than 240
and the cells which are used should not be used again like Cell M16 (i.e. 86) , M19, M18 is used in one combination so it should not be used again.
And 3 or four values which is used should be coloured differently.
if there is any macro you can suggest
Thanks for you support in advance.
I am creating a report. i have a list of different numbers in range M4:M21
What i need is to sum up any 3 or 4 values that can near to 240 but not more than that
For Example I have This List
Range M4 to M21
57 |
81 |
87 |
50 |
85 |
66 |
70 |
72 |
81 |
54 |
82 |
59 |
86 |
53 |
69 |
84 |
63 |
83 |
Now i need Any Combination of 3 values or 4 values which sums the maximum number but should be less than 240.
Like in Above List 86 + 84 + 69 = 239
Then 63 + 82 + 87 = 232
It should give me Like That but not more than 240
and the cells which are used should not be used again like Cell M16 (i.e. 86) , M19, M18 is used in one combination so it should not be used again.
And 3 or four values which is used should be coloured differently.
if there is any macro you can suggest
Thanks for you support in advance.