I'm looking for a formula which will pick a number of numbers and add then and try and get as close as possible to a given number. The number will not be met exactly but must not exceed the number, but I want excel to select the best possible numbers to ensure its as close as possible.
eg:
To get as close to 1000 as possible. (not over, must be under)
Range of numbers: 90, 300, 600, 500, 50.
We know that by picking 90+300+600 = 990 (10 remaining). Is better than 300+600+50 = 950 (50 remaining).
The data numbers I have is about 300 numbers not 5 numbers in the example above, is there a way when the formula selects the most appropriate numbers to total up, it will show which numbers have been selected?
Thanks everyone.
Bookmarks