+ Reply to Thread
Results 1 to 13 of 13

Sort / Rank as per maximum to minimum count

  1. #1
    Forum Contributor
    Join Date
    02-25-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    445

    Sort / Rank as per maximum to minimum count

    Hello Friends

    Please find the attached file (sort as per most frequency 030116.xlsx)

    I want to sort / rank the alphabets as per the count in light yellow cells by formula.

    thanks in advance

    thilag
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Sort / Rank as per maximum to minimum count

    Hi thilag,

    If I understand you correctly, the easiest thing to do is to create a "helper column" in Col B with the same formula you have in E3. Than copy it down.

    Now sort Col A and B in descending order based on Col B.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  3. #3
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Sort / Rank as per maximum to minimum count

    Hi thilag, by amending beaunydal's formula's from
    HTML Code: 
    to suit and using your existing columns D&E as helper columns, see if this works for you.
    Attached Files Attached Files

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sort / Rank as per maximum to minimum count

    use pivot table with sort feature
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Contributor
    Join Date
    02-25-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    445

    Re: Sort / Rank as per maximum to minimum count

    Hello Bearmernsw and David

    thanks for your posts. Bearmernsw the file uploaded by you works fine. Also i need to use the following non array formula in D2 <=IFERROR(INDEX($A$1:$A$100,MATCH(0,INDEX(COUNTIF($D$1:D1,$A$1:$A$100),),)),"")> and drag down then every manual inputs can be removed.

    thanks again

    Let us wait for the solution without helper formulas.

    thilag

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Sort / Rank as per maximum to minimum count

    Hi there, Thilag. try this:

    Regular formula in D2:
    =INDEX($A$1:$A$100,MODE(MATCH($A$1:$A$100,$A$1:$A$100,0)))

    Array formula in D3, copied down:
    =IFERROR(INDEX($A$1:$A$100,MODE(IF(COUNTIF($D$2:D2,$A$1:$A$100)=0,MATCH($A$1:$A$100,$A$1:$A$100,0)+{0,0}))),"")

    Regular formula in E2:
    =COUNTIF(A:A,D2)

    See file...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,370

    Re: Sort / Rank as per maximum to minimum count

    Another version from Glenn's :

    On D2:

    =IFERROR(INDEX($A$1:$A$100,MODE(IF(($A$1:$A$100<>"")*1*ISNA(MATCH($A$1:$A$100, D$1:D1,0)),MATCH($A$1:$A$100,$A$1:$A$100,0)*{1\1}))), "")

    array formula entered and copied down as necessary


    cheers

  8. #8
    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: Sort / Rank as per maximum to minimum count

    The second formula is about as convoluted as they get. It's the only way I could find to sort the A1:A100 range-in-formula (before I saw azumi's remarkable formula). I'm posting anyway.

    In array-entered in E2 to get the counts.

    =LARGE(COUNTIF($A$1:$A$100,IF(FREQUENCY(MATCH($A$1:$A$100,$A$1:$A$100,0),ROW($1:$100)),$A$1:$A$100)),ROWS($1:1))


    then this 'goblin' array-entered in D2.


    =INDEX(INDEX($A$1:$A$100,N(IF(1,MATCH(SMALL(COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),ROW($1:$100)),COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),0)))),SMALL(IF(IF(FREQUENCY(MATCH(INDEX($A$1:$A$100,N(IF(1,MATCH(SMALL(COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),ROW($1:$100)),COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),0)))),INDEX($A$1:$A$100,N(IF(1,MATCH(SMALL(COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),ROW($1:$100)),COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),0)))),0),ROW($1:$100)),COUNTIF($A$1:$A$100,INDEX($A$1:$A$100,N(IF(1,MATCH(SMALL(COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),ROW($1:$100)),COUNTIF($A$1:$A$100,"<="&$A$1:$A$100),0))))))=E2,ROW($1:$100)),COUNTIF($E$2:E2,E2)))

    Edit If column A is sorted this is much easier on the eyes.

    =INDEX($A$1:$A$100,SMALL(IF(IF(FREQUENCY(MATCH($A$1:$A$100,$A$1:$A$100,0),ROW($1:$100)),COUNTIF($A$1:$A$100,$A$1:$A$100))=$E2,ROW($1:$100)),COUNTIF($E$2:$E2,$E2)))
    Last edited by FlameRetired; 01-03-2016 at 03:59 PM.
    Dave

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Sort / Rank as per maximum to minimum count

    Azumi. Looks really good. That formula is definitely a "keeper". Just one thing, should the \ not be a , ????

  10. #10
    Forum Contributor
    Join Date
    02-25-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    445

    Re: Sort / Rank as per maximum to minimum count

    Hello Azumi

    thanks for the formula

    <=IFERROR(INDEX($A$1:$A$100,MODE(IF(($A$1:$A$100<>"")*1*ISNA(MATCH($A$1:$A$100, D$1:D1,0)),MATCH($A$1:$A$100,$A$1:$A$100,0)*{1\1}))), "")>

    but the attached file shows the error message when using your formula. I thing there may be some error in 1/1 area.


    Other formauls workng well thanks.

    thilag.
    Attached Images Attached Images

  11. #11
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,370

    Re: Sort / Rank as per maximum to minimum count

    Quote Originally Posted by thilag View Post
    Hello Azumi

    thanks for the formula

    <=IFERROR(INDEX($A$1:$A$100,MODE(IF(($A$1:$A$100<>"")*1*ISNA(MATCH($A$1:$A$100, D$1:D1,0)),MATCH($A$1:$A$100,$A$1:$A$100,0)*{1\1}))), "")>

    but the attached file shows the error message when using your formula. I thing there may be some error in 1/1 area.


    Other formauls workng well thanks.

    thilag.

    yes sorry about the error, maybe coz my indonesian system, just check the file

  12. #12
    Forum Contributor
    Join Date
    02-25-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    445

    Re: Sort / Rank as per maximum to minimum count

    Thanks to all of the friends who have helped me.

    thanks again

    thilag

  13. #13
    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: Sort / Rank as per maximum to minimum count

    thilag,

    An afterthought:

    Just in case you also want the letters alpha-sorted within their common count groups (which is what the original upload seems to indicate)

    without helper column this is much shorter than my previous attempt.

    For the counts array-enter this in E2 first and fill down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    then array-enter this in D2 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. the maximum and minimum limit
    By madhupangal in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 05:49 PM
  2. Minimum and maximum
    By ikke88 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-06-2015, 04:09 AM
  3. Replies: 2
    Last Post: 09-25-2014, 02:22 PM
  4. Minimum and maximum value of a group
    By dvnr_76 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2014, 02:04 AM
  5. Displaying minimum and maximum rank across columns in a table
    By cwcollins06 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-13-2014, 12:01 AM
  6. [SOLVED] Sum minus up to a maximum and a minimum
    By Rompetelo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2013, 03:58 AM
  7. Maximum and Minimum
    By lurchybold in forum Excel General
    Replies: 6
    Last Post: 10-13-2010, 11:04 AM

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