+ Reply to Thread
Results 1 to 13 of 13

How to divide a group of numbers in to 3 groups as equal as possible.

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    6

    How to divide a group of numbers in to 3 groups as equal as possible.

    Hello,

    I am looking for a way to use excel to divide up a group of numbers into three groups that are as equal as possible. There can be some leeway. I am not sure where to start. What i need this for is to devise a way to balance out a 3 phase electrical panel by evenly distributing the loads across the three phases. I can do it by hand but with many panels to balance an application to sort them would be much more efficient. I have attached a spreadsheet with a group of numbers that would need to be distributed. Any help would be great!
    Attached Files Attached Files

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    herbeey,

    Welcome to the forum!
    Attached is a modified version of the workbook you posted.
    First I created a dynamic named range called listNumbers which is defined with this formula:
    Please Login or Register  to view this content.
    Then in cells C1, D1, and E1 are the headers Group1, Group2, and Group3
    In cell C2 and copied down is this formula (for the first set of numbers):
    Please Login or Register  to view this content.

    In cell D2 and copied down is this formula (for the second set of numbers):
    Please Login or Register  to view this content.

    In cell E2 and copied down is this formula (for the third set of numbers):
    Please Login or Register  to view this content.

    Does that work for you?
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    Hi,

    Does the attached help.

    Column C is your original list but sorted. Column D is a formula which identifies every third row and applies one of three labels. F3:G3 then summarise the totals by group.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    06-27-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    It works great for that group of numbers in that order, if i change the numbers or the order i cant get it to work out evenly.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    herbeey, who are you talking to?

  6. #6
    Registered User
    Join Date
    06-27-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    oh sorry, i was referring to you tigeravatar.

  7. #7
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    When i change the amount of numbers, it works just fine for me. Can you post a sample that is experiencing the problem?

  8. #8
    Registered User
    Join Date
    06-27-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    I included two sets of numbers that i tried to use it on.

  9. #9
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    Is there a reason you're not doing these groups of numbers one at a time? You can copy -> paste special -> values the results of the groups to save the results, either elsewhere in the sheet or on a different sheet. In all cases, it works just fine if you paste the number list into column A.

    I have included an updated version of your workbook, but you can't see me do the intermediate steps. All I did was clear column A (selected the column and pressed Del), then copied one of the sets of numbers and pasted it into column A. The outputs of columns C:E generated the split lists just fine and I did a copy -> paste special -> values over to the right in order to save the results. Wash/rinse/repeat as necessary.

  10. #10
    Registered User
    Join Date
    06-27-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    If you take the group of numbers that was pasted over and sort the set ascending, the splits give a different result. one of the groups is very large and the other is very small. my hope was to have the group totals be a close as possible. if thats possible

  11. #11
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    oooh, you want the group totals to be as close as possible. ok, I misunderstood your requirement. Give these three formulas a try then:

    In cell C2 and copied down:
    Please Login or Register  to view this content.
    In cell D2 and copied down:
    Please Login or Register  to view this content.
    In cell E2 and copied down:
    Please Login or Register  to view this content.

    That will return consistent results regardless of length of data or sort. The totals for each group should be somewhat similar, though it depends on the data's outliers.

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    Quote Originally Posted by herbeey View Post
    ... if i change the numbers or the order i cant get it to work out evenly.
    How near do the totals have to be. Are the totals
    16277
    18701
    17132

    too far apart from the overall average of 17508

  13. #13
    Registered User
    Join Date
    06-27-2013
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: How to divide a group of numbers in to 3 groups as equal as possible.

    i would like them to be as close as possible. for instance doing the sorting by hand i can get them with 800 from lowest to highest. i dont have the actual figures with me at the moment

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1