Number balancer

flammabubble

New Member
Joined
Aug 19, 2015
Messages
24
Hey all,

Lets say I have the following 12 numbers:
1082
1043
1010
1002
1000
1000
995
992
985
984
980
974


I'm looking to find/build a tool within excel which will 'balance' those numbers into two groups of 6 with as close an average as possible. Does anyone have any suggestions as to how I would go about doing this?
 
Last edited:
Here's a way to do it with formulas:

Book1
ABCD
1108201509
210431
310100
410021
51000101003.833
61000111004
79951
89920
99850
109841
119800
129740
Sheet9
Cell Formulas
RangeFormula
C1C1=MATCH(MIN(IF(LEN(SUBSTITUTE(BASE(ROW(INDIRECT("1:4096"))-1,2,12),"1",""))=6,ABS(MMULT((-1)^MID(BASE(ROW(INDIRECT("1:4096"))-1,2,12),{1,2,3,4,5,6,7,8,9,10,11,12},1),A1:A12)),9^9)),IF(LEN(SUBSTITUTE(BASE(ROW(INDIRECT("1:4096"))-1,2,12),"1",""))=6,ABS(MMULT((-1)^MID(BASE(ROW(INDIRECT("1:4096"))-1,2,12),{1,2,3,4,5,6,7,8,9,10,11,12},1),A1:A12)),9^9),0)
D5:D6D5=AVERAGEIF($B$1:$B$12,C5,$A$1:$A$12)
B1:B12B1=MID(BASE($C$1-1,2,12),ROWS($B$1:$B1),1)
Press CTRL+SHIFT+ENTER to enter array formulas.


Put all the numbers marked with 0 in one team, 1 in the other. Unfortunately, I don't know much about Google Sheets, so I can't tell you if converting an Excel formula to GS is any easier than converting an Excel script to GS. The C1 formula is pretty hairy. The formulas are specific to 12 numbers, but I can adapt it if you want to an arbitrary even number (within limits).
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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