+ Reply to Thread
Results 1 to 8 of 8

Need help with function to sort ID # by number of instances

  1. #1
    Registered User
    Join Date
    02-25-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    2

    Need help with function to sort ID # by number of instances

    Hello all,

    I have a list of user id numbers with column for project codes. I need a column of user numbers in order of most frequent to least frequent users and the first and second most common project code for each individual user. I have about 1000 users and 200 project codes.

    Users project ID
    2772014193313 45
    5707019721787 90.1
    2728014156631 28
    9944021574683 23
    7571021559731 45
    0062014161058 45
    2752014152529 92
    2765014231250 92
    2472021646956 90.1
    2735014201012 21
    0084014305453 44
    0071014146767 45
    5712021271901 23
    3637021591357 22
    2792014162880 45
    0072014188672 92
    5709020308585 92
    0057014144069 90.1
    0044014181513 86
    2774014199691 86
    2729014163395 99
    3609021582019 99
    0075014189667 52
    2732014233685 55
    1881014152155 64
    5707020025648 66
    2759014170424 64
    3613021554476 90.2
    5707020015943 90.3
    0051014211164 45
    3616021569353 44
    2788014223373 67
    1880014157040 66
    3623021547947 65
    0087014174006 46
    2787014172910 58
    2767014367857 55


    Thank you for any help you can provide.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,443

    Re: Need help with function to sort ID # by number of instances

    I suspect the easiest way would be to insert a Pivot Table.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need help with function to sort ID # by number of instances

    I have a list of user id numbers with column for project codes. I need a column of user numbers in order of most frequent to least frequent users and the first and second most common project code for each individual user.
    Given the upload data this seems counter intuitive. All the user ID numbers (column A?) are unique. There are no "most frequent users".

    Do you mean the other way around? Those instructions are only doable with column B.
    Dave

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need help with function to sort ID # by number of instances

    See what I mean in the upload.

    Formula in E2 and filled down is array-entered. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formula in F2 is also array-entered, filled down and across until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The results of the first formula look like this. Column D has the counts of each item in column E. It is there for visual confirmation and has no function in either of the above formulas.


    D
    E
    1
    Counts
    Freq. Users (?)
    2
    6
    45.0
    3
    4
    92.0
    4
    3
    90.1
    5
    2
    99.0
    6
    2
    86.0
    7
    2
    66.0
    8
    2
    64.0
    9
    2
    55.0
    10
    2
    44.0
    11
    2
    23.0
    12
    1
    90.3
    13
    1
    90.2
    14
    1
    67.0
    15
    1
    65.0
    16
    1
    58.0
    17
    1
    52.0
    18
    1
    46.0
    19
    1
    28.0
    20
    1
    22.0
    21
    1
    21.0

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need help with function to sort ID # by number of instances

    Another (simpler way), although the counts in column D are now helpers to this formula. The formula array-entered in F2 can be
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    filled down and across until you get blanks.
    Last edited by FlameRetired; 02-26-2017 at 02:06 AM.

  6. #6
    Registered User
    Join Date
    02-25-2017
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    2

    Re: Need help with function to sort ID # by number of instances

    Made it work with a pivot table, couldn't make the functions work for me. Not sure how to mark this as solved.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,443

    Re: Need help with function to sort ID # by number of instances

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,443

    Re: Need help with function to sort ID # by number of instances

    You're welcome. Thanks for the rep.

+ 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. Replies: 12
    Last Post: 02-12-2017, 06:09 PM
  2. sort by number of instances
    By monere in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-08-2015, 06:42 AM
  3. Sort function sorting by formula not number
    By Peke in forum Excel General
    Replies: 1
    Last Post: 09-08-2010, 08:00 AM
  4. How do I sort multiple instances SOLVED
    By wkbrdr in forum Excel General
    Replies: 2
    Last Post: 09-20-2009, 11:01 PM
  5. Sort by largest number in column by Formula Function
    By termal in forum Excel General
    Replies: 5
    Last Post: 05-04-2009, 07:46 PM
  6. Function to count number of text instances
    By davelarue in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-18-2008, 04:39 AM
  7. [SOLVED] How to sort number with text in large function?
    By Clara in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-18-2005, 08:05 AM

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