+ Reply to Thread
Results 1 to 7 of 7

Equal or Even Distribution/Division

  1. #1
    Registered User
    Join Date
    01-02-2022
    Location
    Colorado
    MS-Off Ver
    Microsoft Office 365
    Posts
    22

    Question Equal or Even Distribution/Division

    I couldn't think of better subject line - if there's an actual terminology for this, please let me know.

    I'm trying to figure out a way to divide a number across several groups of 3, 4, or 'n'.
    Say I have a number of people, 37 for example, using groups of 4, that gives me 9 groups and 1 person remaining. Rather than having a single person remaining, I'd like to distribute that more evenly by taking people from other groups. Essentially I'm looking to end with 7 groups of 4 (28), and 3 groups of 3 (9) for a total of 37.

    So, 37 into groups of 4 => 7 groups of 4 (28) plus 3 groups of 3 (9) for a total of 37
    Or, 42 into groups of 4 => 9 groups of 4 (36) plus 2 groups of 3 (6) for a total of 42.

    However, there's one caveat: if the remainder is only ONE away from a full group (from initial division), don't do anything. So taking 35 into groups of 3 as an example, I can have 11 groups of 3 (33), and a single group of 2 for a total of 35. That last group is only 1 away from a full group and that's ok.

    So, 35 into groups of 3 => 11 groups of 3, plus 1 group of 2.
    But, 34 into groups of 3 => 10 groups of 3, plus 2 groups of 2.

    Similarly, in groups of 4:
    31 into groups of 4 => 7 groups of 4, plus 1 group of 3.
    But, 33 into groups of 4 => 6 groups of 4, plus 3 groups of 3.

    If there a way to do this with formulas? Right now I'm manually entering in the information and doing calculations as I fill in groups. See attached Excel file with the sheet I'm currently using to do this manually. I reset everything to 0's then manually start filling in the groups.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Equal or Even Distribution/Division

    For D7 (and copy to G7 etc) use the following formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    for D10 (and copy down) probably a bit overcomplicated, but works:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You may copy and paste special as formula (to keep your conditional formatting) to G10, etc.

    Or (I did it for column J and M in attached file) use similar formula, working also in older versions of excel - without CEILING.MATH function
    So J10 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Equal or Even Distribution/Division

    Indeed overcomplicated. Probably still there is a room for simplifying, but for D10 (and copy down, and then copy and paste special as formulas to G, J and M columns):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-02-2022
    Location
    Colorado
    MS-Off Ver
    Microsoft Office 365
    Posts
    22

    Re: Equal or Even Distribution/Division

    Thank you Kaper for providing both solutions, with and without CELING.MATH. They both seem to work fine.

    Now I'll go break it up so I can better understand the backend of that formula.

    Thanks again!

  5. #5
    Registered User
    Join Date
    01-02-2022
    Location
    Colorado
    MS-Off Ver
    Microsoft Office 365
    Posts
    22

    Re: Equal or Even Distribution/Division

    Probably needs more refining, but in the event that there are a very low number of students, things go wrong. For example, if I were to enter 6 for total students, for column M it shows 2 groups of 4 => that's 2 extra ghost students. If I enter 11 students, column M shows 3 groups of 4. Similarly, if I only enter 5 students, column J shows 2 groups of 3.

    12 and higher appears to calculate ok.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Equal or Even Distribution/Division

    Do you really have an idea to divide 11 or especially 6 persons into 5-members groups???

    The general formula working also for very small numbers would be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It can be copied to all cells.

    To not complicate it even more, I would then change formula ONLY in cell M10 to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to have a special treatment of 6 persons in 5-persons group, which you probably would like to divide into 3-3 (not 4-2) way.

    So now the tool is valid for any number of students between 0 and 42. If you need more than 42 new rows shall be added.

    I've added also columns O and P for 6-students groups. In this case special formulas are needed for P10 and P11 cells. You may see them in the attached file.

    If you think of more than 6 students per group calculated that way, and allow for small number of students in the pool to be divided probably different strategy shall be used.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-02-2022
    Location
    Colorado
    MS-Off Ver
    Microsoft Office 365
    Posts
    22

    Re: Equal or Even Distribution/Division

    To be perfectly honest, no I don't need to know how to split low numbers like that. However, as soon as I shared it with my work collegues, someone immediately spoke up saying she couldn't use small numbers and that the tool is "broken". Despite several of us saying there's no NEED to know how (to split small numbers), I knew the only way to please her (and make her stop complaining) was to have it work properly. She's one of those folks who live by 'Either it works correctly, or it's broken (and doesn't work at all.)"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Distribution % equal to total allowed
    By eddiecruz in forum Excel General
    Replies: 3
    Last Post: 08-20-2020, 07:22 PM
  2. [SOLVED] Equal distribution from 1 column to different rows
    By mukuljain99 in forum Excel General
    Replies: 4
    Last Post: 11-02-2019, 03:48 AM
  3. Macro for equal distribution !
    By Arunkumaramk in forum Excel Programming / VBA / Macros
    Replies: 172
    Last Post: 03-31-2019, 09:59 AM
  4. Equal distribution of list items with VBA
    By kingoftheace in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2015, 10:49 AM
  5. Calculating equal distribution
    By newbie4 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2012, 02:00 PM
  6. Equal Distribution Of Funds Question
    By Brandens in forum Excel General
    Replies: 1
    Last Post: 11-15-2011, 03:10 PM

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