Hi,
I'm looking for an algorithm that can calculate all possible combinations from a list of numbers that fits a target number. For example:
The numbers are stored in column A. Each number has price stores in column B.
## A B
1 1 9$
2 5 12$
3 2 4$
4 3 3$
5 4 2$
6 7 5$
Target Value: 10
Required answers: 2*A2 or A1+A2+A5 or 5*A3 or 2*A5+A3 and so on...
Than, it should chose the profitable combination. For example:
2*A2 24$
A1+A2+A5 23$
5*A3 20$
2*A5+A3 8$
Therefore, 2*A5+A3 is the profitable combination...
I'd be grateful to your help!!!
Thanks,
Oren
Bookmarks