+ Reply to Thread
Results 1 to 7 of 7

How to assign numbers in sequence for a cluster

  1. #1
    Registered User
    Join Date
    06-05-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    How to assign numbers in sequence for a cluster

    Hi, below is my problem:

    I want to assign numbers in sequence to group with atleast 25 members in it.

    Group1 Cluster number Explanation:
    15 1 (15 is less than 25. So, I want to add to next group number i.e 5 . After adding
    5 1 to next group it is 15+5 = 20 , which is still less than 25. So, I will also add the
    5 1 3rd group number . Now it is 15+5+5=25 and I want to give it cluster number 1)
    27 2 -This has 27 members in group1, so I want to give it cluster2
    30 3 -Same reason as above
    12 4 (-This has 12 members, which is less than 25, so will add to next member which is 15.)
    15 4 So, 12+15 = 27 which is more than 25. Hence 12 and 15 should be under one cluster i.e cluster 4 . As of now, I just have group 1 values. How do I assign the cluster numbers in excel using a function?

    Please help

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to assign numbers in sequence for a cluster

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-05-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How to assign numbers in sequence for a cluster

    Thanks very much !!!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to assign numbers in sequence for a cluster

    You're welcome.

  5. #5
    Registered User
    Join Date
    06-05-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How to assign numbers in sequence for a cluster

    Hello shg, your formula works great but I am not getting the logic at all.

    SUMIF( range, criteria, [sum_range] ) >=25

    I understand the standard SUMIF syntax but I don't understand at all how your formula is working
    Can you please breakdown in layman terms and help me understand the logic you used.

    Thank you very much for your time !

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to assign numbers in sequence for a cluster

    The cluster number is the same as the prior number unless the prior cluster already has >=25 members.

    The expression (SUMIF(B$1:B1,B1,A$1:A1) >= 25) returns True or False. When it becomes part of an arithmetic expression, True is coerced to 1 and False to 0, so it either adds one or doesn't.
    Last edited by shg; 06-07-2013 at 03:21 PM.

  7. #7
    Registered User
    Join Date
    06-05-2013
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How to assign numbers in sequence for a cluster

    got it. Thank you very much

+ 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