How to arrange multipe cells from list so they fulfill condition

Fractious

New Member
Joined
Nov 14, 2022
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
I am trying to arrange an automated Christmas-gift "who's going to buy to who, and for how much" excel sheet. the sheet is divided into "groups", marked with thick lines, which indicates a specific houshold to the left. I need to find a formula, macro, something that can insert names in M along with the amount (gift budget) in N from the list to the right, and into the cells in the I column and J column, so that the summed value of the group in the J column is equal to or close to the number in the H column. The balance in column K indicates the difference between the sum of the group in the J column, and the amount in the H column. It is generally OK that the balance is up to +/- 300 DKK. I have tried with RANDBETWEEN, INDEKS and IF functions, but i need something more clever.

Maybe put in another way: Is there any way to make sure that all names along with amounts in coulmns M and N can be inserted with no duplicates in column I and J, with the criteria that the difference between the sum of e.g. J11-J14 and H14, must not be greater than 300?

Help is very much appreciated, and might give you a row in the christmas gift list.
1668461602671.png
 

Attachments

  • 1668461478663.png
    1668461478663.png
    31.6 KB · Views: 5
  • 1668461553243.png
    1668461553243.png
    32.6 KB · Views: 5

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top