+ Reply to Thread
Results 1 to 7 of 7

Create equal groups based on multiple criteria

  1. #1
    Registered User
    Join Date
    09-14-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    67

    Create equal groups based on multiple criteria

    I need to create 4 equal groups (a, b, c, and d) where they have an equal amount of passings (column N) per Hub (column AG). The groupings will consist of a list of nodes (column b). I know the groups won?t be exactly equal but I need them as close to equal as possible. The data in A through AE is the raw data and may change from time to time so ideally I?d be able to refresh and still keep the groups equal.



    turf group screenshot.PNG

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Create equal groups based on multiple criteria

    Post a file with your sample data and and example of what you expect. Just looking at your picture, Hub 5 has one node with 137 passings - unless the total passings for hub 5 is 4 times that (about 550), there would be no way to split those into 4 groups with "an equal amount of passings .... per Hub"
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    09-14-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Create equal groups based on multiple criteria

    modifying sample workbook for upload
    Last edited by dizjackson; 08-24-2023 at 12:11 PM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Create equal groups based on multiple criteria

    HOW TO ATTACH YOUR SAMPLE WORKBOOK:

    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.

  5. #5
    Registered User
    Join Date
    09-14-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Create equal groups based on multiple criteria

    Sample attached. I'm thinking I'd need to determine the average number of passings for each hub then have a formula that adds the nodes to each group with the average for that hub being the max. In the actual data there will be 20 hubs and 1000s of nodes.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Create equal groups based on multiple criteria

    The attached has a macro that assigns groups, and formulas to extract them into the table. The macro is run by clicking the button at the top of column AL - it will work with however many data points you have.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-14-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    67

    Re: Create equal groups based on multiple criteria

    Thank you!

    When I copy and paste my data into this file and run the macro I get the error "run-time error '6': overflow".

    What would be the function of the numbers in column 'AL'. There are no numbers in that column for the data that extends past the sample set.

    I don't see anywhere in the Macro that references column AG. I'm wanting each group to have equal passings (column N) per hub (column AG).

    Also, is there anyway to bring which group back each row ends up inm based on the macro, back into the report as an additional column - that would make it easier for filtering.

    Updated sample attached
    Attached Files Attached Files

+ 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. Randomly Assign to Groups of Equal Size, but groups already have members
    By RosaL123 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2023, 06:34 AM
  2. Divide into distinct groups based on multiple criteria
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2019, 10:36 PM
  3. [SOLVED] Create a table based on top ranking criteria, based on multiple fields.
    By stevensimon10482 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-13-2017, 08:49 PM
  4. Replies: 1
    Last Post: 06-03-2015, 06:27 PM
  5. Replies: 3
    Last Post: 07-24-2013, 04:48 PM
  6. MACROS: Sort by multiple criteria - Create tabs based off of criteria
    By svineyard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2009, 10:48 AM
  7. Create multiple lines based upon criteria
    By SystemsAccountant in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-05-2008, 01:14 PM

Tags for this Thread

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