+ Reply to Thread
Results 1 to 8 of 8

Sort a Range - by 2 Columns - Formula

  1. #1
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Sort a Range - by 2 Columns - Formula

    In attached, I have a 3 Columns range, columns B:D
    Desired result is in J:L, which is Sorted FIRST Z to A in column C and then smal to large in column B
    I would like a formula for this but clasic way since i do not have latest ...sort,filter..
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Sort a Range - by 2 Columns - Formula

    Hi ionelz,

    If you open the sort dialog it allows you to add more levels of sorting and switch them to what you want. Have you seen that dialog? I think it solves your problem. See it at:
    https://support.office.com/en-us/art...4-a02205834d72
    I don't think you need a Custom Sort just add levels.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Sort a Range - by 2 Columns - Formula

    But when I change data in B:D I want in J:L automatic update/sort
    Data in B:D keep changing, actually I do this :
    In B:D , I import data with a VBA macro from another file
    In J:L I want it sorted that way !
    Then I clear B:D and import another one ....
    I was thinking a formula at J:L will solve it or a macro at J:L but not sure how to do it...
    Last edited by ionelz; 03-21-2020 at 12:11 PM.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Sort a Range - by 2 Columns - Formula

    Because you have the latest version of Excel you might use the new =Sort() spill function..
    https://support.office.com/en-us/art...d-c20e8e44b86c
    If that isn't good enough then keep asking...

  5. #5
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Sort a Range - by 2 Columns - Formula

    I already said that in my first post ! that I need clasic formula not latest functions

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Sort a Range - by 2 Columns - Formula

    @ionelz

    Hi
    please remember that this forum is manned by volunteers helping you for free on their spare time.
    It seems logical that those trying to help you are treated courteously, and not brutally like your last post. After all, do you always read posts or forum rules entirely.....?
    So you probably understand why Marvin might have missed your requirement
    After checking your threads, it also looks like the words " Hello", "Thank you", etc.. are auto deleted by your keyboard ?
    Might I suggest you correct that flaw ? I'm sure our members will appreciate and will be glad to help
    Success and have a nice day

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Sort a Range - by 2 Columns - Formula

    Hi ionelz,

    The classic (not clasic) way to do this is to use Custom Sort.
    See https://support.office.com/en-us/art...e-2e545c4a4654
    If you don't want to use the Multi-Level Custom Sort then you can sort your second column first followed by the first one.

    I don't believe there is a single formula that would do what you want. I'm sure that VBA could do it but that isn't what you wanted either. Sometimes we just want too much. Now that I've said that...
    Let's see if one of the Smart Guru's can find a formula. Will you accept helper columns to assist a formula to get an answer?

  8. #8
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Sort a Range - by 2 Columns - Formula

    Thanks all, and I did not mean to offend anyone ! I got so many answers/responds from all of you so thanks
    I solved simple with SortBy, but in one place I have this option (insider) and in other place no

+ 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] Sort columns in range based on selected row
    By Brontosaurus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2019, 10:52 AM
  2. [SOLVED] Sort 3 Columns in a defined range
    By Parth007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2016, 07:11 AM
  3. Formula to sort columns instead of using the sort button
    By Hyflex in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2016, 10:20 PM
  4. sort range, then subtotal 2 different columns
    By jellyjen17 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2014, 10:22 AM
  5. [SOLVED] Sort Columns, change entire Range
    By cp41 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 01:11 PM
  6. [SOLVED] VBA Sort Range - More than 3 Columns - Need a fourth
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2013, 05:11 PM
  7. How to set global variable to certain range and use it to sort columns
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-09-2011, 09:40 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