# Tricky Group Combinations

##### New Member
Hey everyone... I am hoping someone knows of an easy way to accomplish this via vba.

I have many orders where there are 1-6 items in the order.
Here is an array of items for an order.

SKU , Supplier , Cost
Sku1,supplier1, 20
sku1,supplier3, 3.2
sku2,supplier2, 2
sku2,supplier1, 3
sku2,supplier3, 4
sku3,supplier1, 4.1
sku4,supplier1, 4
sku4, supplier2, 5

The result I would hope to have the lowest possible cost of groups by supplier with list of skus. Sku can only belong to 1 group. Each group adds 5 to the total cost.

Some of the results would be like this

Supplier1
Sku1,sku2,sku3,sku4 = 31.1 + 5 = 36.1

or

Supplier1 + Supplier3
(Supplier1 sku2,sku3,sku4 = 11.1) + (Supplier3 Sku1 = 3.2) = 14.3 + 5 + 5 = 24.3

and so on for every possible supplier solution. Anyone help me with this or point me in the right direction?

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

Replies
3
Views
168
Replies
6
Views
282
Replies
1
Views
226
Replies
9
Views
2K
Replies
4
Views
388

1,206,945
Messages
6,075,786
Members
446,156
Latest member
Aaro23

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back