+ Reply to Thread
Results 1 to 8 of 8

Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

  1. #1
    Registered User
    Join Date
    07-10-2021
    Location
    GENEVA
    MS-Off Ver
    EXCEL FOR MAC MICROSOFT 365
    Posts
    80

    Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    I am running Excel365 on a Mac. I want to combine the two sets of data a2:c5 and f2:h4 into a single list, but my formula in the heading
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    does not seem to work. It just sits there as if it was text, not even an error message. Is this a problem with Mac, or a problem with my use of the curly brackets?. I have also tried replacing the semicolon with a comma, but that does not help (error message).

    The example shown is a very simplified version of a very large and complex spreadsheet. I know that in this simple example I could just copy and paste the two ranges together and then sort them, but that's not practical in my big spreadsheet because the data is constantly changing both in content and size. I'm looking for the simplest formula possible.

    By the way, I have run this problem through a number of AI bots, including a few specialising in Excel solutions, but not one of them has come up with a working formula. Any suggestions for an Excel bot which works well, would be appreciated.

    Screenshot 2024-01-29 at 09.07.30.png
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,870

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    Your desired output is not in chronological order.

    There's a function for this (VSTACK):

    =SORT(VSTACK(A2:C5,F2:H4),3,1)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    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,447

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    Try VSTACKing the ranges before the sort.
    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


  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,870

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    I forgot to attach the workbook - here it is.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-10-2021
    Location
    GENEVA
    MS-Off Ver
    EXCEL FOR MAC MICROSOFT 365
    Posts
    80

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    Quote Originally Posted by AliGW View Post
    Your desired output is not in chronological order.
    Correct. How careless of me!

    Thank you for bringing the VSTACK function to my attention. It is just what I need. It's a pity that none of the Excel AI bots mentioned =VSTACK.

    I'm still wondering why my original formula doesn't work. Well that's not so important now you have solved this for me!
    =SORT(VSTACK(A2:C5,F2:H4),3,1)

  6. #6
    Registered User
    Join Date
    07-10-2021
    Location
    GENEVA
    MS-Off Ver
    EXCEL FOR MAC MICROSOFT 365
    Posts
    80

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    Quote Originally Posted by TMS View Post
    Try VSTACKing the ranges before the sort.
    Thank you TMS for mentiong the VSTACK function. Please see my reply to AliGW.

    You guys are clearly better than the AI Bots, even the ones which claim to be good at Excel!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,870

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    It doesn't work because Excel will not recognise the ranges in that circumstance in the way you defined them - simple as that.

    The AI bots are only as good as your description of what you want - either that wasn't clear or the AI bots are still not that good. I would still use humans for this sort of thing, personally.

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  8. #8
    Registered User
    Join Date
    07-10-2021
    Location
    GENEVA
    MS-Off Ver
    EXCEL FOR MAC MICROSOFT 365
    Posts
    80

    Re: Why doesn't the formula =SORT({A2:C6;F2:H6},3,1) work?

    Thank you AliGW. All done! Humans still rule the intelligence world. AI Bots are very good at answering "general knowledge" questions and "problem solving" questions where I could figure out the answer myself or with a google search, but they are not much good when there is a question that has stumped me and the solution is not easily found with a google search.

+ 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. PIVOT Sort doesn't work with addition of column field?
    By pmjewett in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 10-21-2022, 07:08 PM
  2. Why the sort doesn't work here?
    By woshichuanqilz in forum Excel General
    Replies: 11
    Last Post: 04-17-2017, 11:38 AM
  3. [SOLVED] Why DOESN'T this Sort Code work?
    By CaptMac in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-18-2016, 02:42 PM
  4. [SOLVED] FORMULA DOESN'T WORK
    By Loyd in forum Excel General
    Replies: 4
    Last Post: 03-30-2006, 01:20 PM
  5. why doesn't sort work when it's choosen before protecting sheet
    By Mearll in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2006, 03:35 PM
  6. [SOLVED] the date format is not working ,sort by date doesn't work.
    By Rosa Campos in forum Excel General
    Replies: 1
    Last Post: 09-12-2005, 06:05 PM

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