Input Data:
I have a data table with 3 columns:
Example of a sample part of Input data is attached
Output Data required:
In order to process payment to several suppliers every day, I need to create “payment groups” comprising of Supplier Nos and Location Nos in our accounting software.
Conditions
Please help me with excel formula/VBA code, to determine the best possible combination sets of Supplier No. and Location ID for creating “payment groups” with the below conditions:
I have a data table with 3 columns:
- Supplier No.
- Location No.
- Payable/(Receivable Amount
Example of a sample part of Input data is attached
Output Data required:
In order to process payment to several suppliers every day, I need to create “payment groups” comprising of Supplier Nos and Location Nos in our accounting software.
Conditions
Please help me with excel formula/VBA code, to determine the best possible combination sets of Supplier No. and Location ID for creating “payment groups” with the below conditions:
- No. of payment groups prepared is minimum.
- Maximum 10 No. of location IDs can be used in each group.
- Net grouped amount of each and every vendor in any payment group is positive.
Book4 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Supplier No. | Location No. | Amount Payable/-Receivable | ||
2 | 27029 | 110 | 7,36,654 | ||
3 | 111 | 15,78,320 | |||
4 | 27094 | 112 | 6,62,450 | ||
5 | 27090 | 113 | 32,11,385 | ||
6 | 27069 | 114 | 2,72,908 | ||
7 | 27026 | 114 | 14,27,552 | ||
8 | 27071 | 115 | 2,62,161 | ||
9 | 27094 | 116 | -512 | ||
10 | 117 | 2,66,339 | |||
11 | 118 | -12,278 | |||
12 | 119 | -3,070 | |||
13 | 120 | 15,56,969 | |||
14 | 27034 | 117 | 72,552 | ||
15 | 120 | 1,63,404 | |||
16 | 27059 | 120 | 1,09,069 | ||
17 | 121 | 18,431 | |||
18 | 122 | 1,26,463 | |||
19 | 27041 | 123 | 18,22,797 | ||
20 | 27095 | 123 | 2,14,332 | ||
21 | 124 | 1,14,217 | |||
22 | 27012 | 125 | 3,95,874 | ||
23 | 27062 | 112 | 2,54,339 | ||
24 | 27010 | 115 | 9,40,853 | ||
25 | 27093 | 126 | 1,78,133 | ||
26 | 27043 | 127 | 98,669 | ||
27 | 123 | 1,17,560 | |||
28 | 27052 | 127 | 97,295 | ||
29 | 123 | 59,452 | |||
30 | 27057 | 127 | 33,101 | ||
31 | 123 | 1,17,027 | |||
32 | 27016 | 127 | 1,64,141 | ||
33 | 27004 | 127 | 1,29,272 | ||
34 | 123 | 1,17,494 | |||
35 | 27081 | 127 | 32,842 | ||
36 | 123 | 2,35,920 | |||
37 | 27095 | 127 | 98,447 | ||
38 | 123 | 1,17,627 | |||
39 | 27003 | 127 | 1,29,468 | ||
40 | 123 | 1,17,560 | |||
41 | 27012 | 127 | 33,816 | ||
42 | 123 | 1,17,828 | |||
43 | 27023 | 127 | 1,31,882 | ||
44 | 27098 | 127 | 1,32,013 | ||
45 | 27066 | 127 | 1,05,635 | ||
46 | 27067 | 127 | 1,64,940 | ||
47 | 27088 | 127 | 33,816 | ||
48 | 123 | 1,17,227 | |||
49 | 27055 | 123 | 1,18,094 | ||
50 | 128 | -2,444 | |||
51 | 27071 | 129 | -1,000 | ||
52 | 130 | 54,177 | |||
53 | 27047 | 131 | 4,854 | ||
54 | 132 | 2,81,784 | |||
55 | 27053 | 133 | 6,549 | ||
56 | 132 | 11,54,029 | |||
57 | 134 | 18,755 | |||
58 | 27054 | 132 | 1,22,018 | ||
59 | 27055 | 133 | 8,826 | ||
60 | 132 | 4,17,359 | |||
61 | 27066 | 112 | 10,08,036 | ||
62 | 27087 | 112 | 5,49,803 | ||
63 | 27012 | 112 | 8,70,079 | ||
64 | 27079 | 127 | 33,160 | ||
65 | 123 | 1,17,828 | |||
66 | 128 | -977 | |||
67 | 27078 | 135 | 72,300 | ||
68 | 27037 | 136 | -2,08,524 | ||
69 | 137 | 5,11,147 | |||
70 | 112 | 77,901 | |||
71 | 27038 | 136 | -1,37,044 | ||
72 | 137 | -20,005 | |||
73 | 112 | 28,934 | |||
74 | 27053 | 137 | 3,15,715 | ||
75 | 27076 | 111 | 1,32,996 | ||
76 | 27077 | 111 | 2,46,981 | ||
77 | 27085 | 113 | 7,51,573 | ||
78 | 27097 | 138 | 2,25,628 | ||
79 | 27007 | 138 | 5,29,166 | ||
80 | 27008 | 138 | 4,72,631 | ||
81 | 27050 | 139 | 1,73,094 | ||
82 | 27051 | 139 | 5,47,820 | ||
83 | 27001 | 115 | 7,12,246 | ||
84 | 27010 | 115 | 3,66,801 | ||
85 | 27040 | 115 | 4,74,174 | ||
Sheet1 |