+ Reply to Thread
Results 1 to 8 of 8

Dynamic Sort Formula (Multiple Columns)

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Philippines
    MS-Off Ver
    O365
    Posts
    49

    Dynamic Sort Formula (Multiple Columns)

    Hi. Good day!

    is there a way to create a dynamic Sort formula that will sort multiple columns that is based on selection?

    I actually have a formula in a cell that makes this: "SORT(ToRank_List,{8,10,14,11,13}, -1)" the part {8,10,14,11,13} actually changes based on the selection that I have used. When I tried to use indirect it doesn't work and gives me error. Is there a way to make this work? or is there a better way on doing this?

    Thank you so much!

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Dynamic Sort Formula (Multiple Columns)

    Suppose your data from "B2" to "B8"
    in "C2"
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ToRank_List = Name Manager [select range "B2" to "B8"]


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    Philippines
    MS-Off Ver
    O365
    Posts
    49

    Re: Dynamic Sort Formula (Multiple Columns)

    Thank you for the reply and apologies for not explaining further.

    I have a attached a file for the expected output.

    In the attachment, column J can be changed based on the preference. In the attached file it shows that the sorting is based on total, score2, score3...
    there will be times that this might change, so just wondering if it's possible to have the formula generated in cell M3 to be dynamic
    and will base the sort order on the selection in column J
    Attached Files Attached Files

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Dynamic Sort Formula (Multiple Columns)

    In M3 then drag down and accross:
    Please Login or Register  to view this content.
    Quang PT

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Dynamic Sort Formula (Multiple Columns)

    Quote Originally Posted by Krix View Post
    I actually have a formula in a cell that makes this: "SORT(ToRank_List,{8,10,14,11,13}, -1)" the part {8,10,14,11,13} actually changes based on the selection that I have used. When I tried to use indirect it doesn't work and gives me error. Is there a way to make this work?
    Replace the array constant with the range reference - so, per your sample, use: =SORT(A3:F12,K2:K6,-1)

    please also update your profile to highlight you're using O365.

  6. #6
    Registered User
    Join Date
    02-20-2013
    Location
    Philippines
    MS-Off Ver
    O365
    Posts
    49

    Re: Dynamic Sort Formula (Multiple Columns)

    Hi @bebo0219999 thank you for your reply. I actually need something that auto fills that formula. Hence, I used SORT.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Dynamic Sort Formula (Multiple Columns)

    Quote Originally Posted by Krix View Post
    Hi @bebo0219999 thank you for your reply. I actually need something that auto fills that formula. Hence, I used SORT.
    I would misunderstand, but my formula is dynamic, isn't it?

  8. #8
    Registered User
    Join Date
    02-20-2013
    Location
    Philippines
    MS-Off Ver
    O365
    Posts
    49

    Re: Dynamic Sort Formula (Multiple Columns)

    Hi @XLent, all good now. I actually tried that at first and gives me error if there's a blank. What I did is just nested ifs. Thank you for help!

    Also, my profile is now updated thank you for reminding. :D

+ 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] Merge and sort two columns in a dynamic defined sequence
    By DHT_Tech in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-11-2018, 02:10 PM
  2. [SOLVED] Dynamic Unique List from multiple dynamic columns
    By JO505 in forum Excel General
    Replies: 7
    Last Post: 06-11-2015, 05:41 PM
  3. Summarizing multiple dynamic columns with a formula
    By YellowOnline in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-30-2015, 07:59 AM
  4. multiple sort of named dynamic range in a macro
    By arb99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2015, 01:45 AM
  5. [SOLVED] Using an array formula to sort alphabetically over multiple columns
    By AliGW in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-14-2014, 02:13 PM
  6. [SOLVED] Sort by multiple columns with sort criteria cell dependent
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-24-2014, 02:22 AM
  7. Replies: 2
    Last Post: 03-22-2013, 03:23 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