+ Reply to Thread
Results 1 to 5 of 5

Sorting Results from VSTACK, FILTER with CHOOSECOLS

Hybrid View

  1. #1
    Registered User
    Join Date
    11-28-2023
    Location
    BC, Canada
    MS-Off Ver
    MS 365
    Posts
    2

    Sorting Results from VSTACK, FILTER with CHOOSECOLS

    Good morning,

    I've got a fairly simple table from which I am extracting data from in a new worksheet using CHOOSECOLS, VSTACK, & a FILTER. The simple question is how to add a sort to the result set from the formula below. Standard sorting will not work on an array.
    The SORTBY would be on columns 8 (Column E, descending) and 6 (Column D, ascending).

    Formula is currently =CHOOSECOLS(VSTACK(Table1[#Headers],FILTER(Table1,Table1[New Assign?]=Sheet6!C4,"")),2,5,6,8,9)

    Thank you!
    DVS

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

    Re: Sorting Results from VSTACK, FILTER with CHOOSECOLS

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    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

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,769

    Re: Sorting Results from VSTACK, FILTER with CHOOSECOLS

    Not sure what you mean by
    The SORTBY would be on columns 8 (Column E, descending) and 6 (Column D, ascending).
    as col 8 is I & col 6 is F, but this will sort on cols 8 & 6
    Formula: copy to clipboard
    =sort(CHOOSECOLS(VSTACK(Table1[#Headers],FILTER(Table1,Table1[New Assign?]=Sheet6!C4,"")),2,5,6,8,9),{4,3},{-1,1})

  4. #4
    Registered User
    Join Date
    11-28-2023
    Location
    BC, Canada
    MS-Off Ver
    MS 365
    Posts
    2

    Re: Sorting Results from VSTACK, FILTER with CHOOSECOLS

    Thanks Fluff13! Your solution was almost perfect.
    The sort was in the wrong spot as it included the column headings...made the following change and it sorts correctly.

    =CHOOSECOLS(VSTACK(Table1[#Headers],SORT(FILTER(Table1,Table1[New Assign?]=Sheet6!C4,""),{4,3},{-1,1})),2,5,6,8,9)

    I didn't know how the SORT function and {} brackets work with an array. Excellent info!
    Last edited by drvs; 11-28-2023 at 04:42 PM.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,769

    Re: Sorting Results from VSTACK, FILTER with CHOOSECOLS

    Glad to help & thanks for the feedback.

+ 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. CHOOSECOLS and add a blank column
    By elischwa in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-22-2024, 03:13 PM
  2. [SOLVED] Add Additional FILTER to VSTACK
    By BiblioManiac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-22-2023, 03:32 PM
  3. Take,ChooseCols,Sort Function Not Showing Output In A Particular Cell
    By quentinlemmer in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 07-07-2023, 08:52 AM
  4. VSTACK results of indirect references from an array
    By tdarenkov in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-16-2023, 04:11 AM
  5. [SOLVED] Problem when filter named ranges using VSTACK
    By oteixeira in forum Excel General
    Replies: 6
    Last Post: 01-18-2023, 03:37 PM
  6. Replies: 3
    Last Post: 04-27-2017, 05:25 PM
  7. Replies: 3
    Last Post: 03-31-2010, 11:47 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