+ Reply to Thread
Results 1 to 11 of 11

Sorting an Array Formula

  1. #1
    Registered User
    Join Date
    09-04-2019
    Location
    Canada
    MS-Off Ver
    O365
    Posts
    9

    Sorting an Array Formula

    Hello everyone,

    I have an array formula that works great and gives me the resulting list that I need. However, I would like to sort this list alphabetically so that the users who view the report do not have to search for their name (I could very easily filter the list so they could select their name - but even this is very problematic for them). The formula I currently have is:

    {=IFERROR(IFERROR(IFERROR(IFERROR(INDEX('BF Beginning'!$W$2:$W$500,MATCH(ROWS(A$1:$A1)-1,COUNTIF($A$1:A1,'BF Beginning'!$W$2:$W$500)+('BF Beginning'!$W$2:$W$500=""),0)),INDEX(New!$X$2:$X$500,MATCH(0,COUNTIF($A$1:A1,New!$X$2:$X$500)+(New!$X$2:$X$500=""),0))),INDEX('Closed or Transferred'!$Z$2:$Z$483,MATCH(0,COUNTIF($A$1:A1,'Closed or Transferred'!$Z$2:$Z$483)+('Closed or Transferred'!$Z$2:$Z$483=""),0))),INDEX('BF End'!$W$2:$W$498,MATCH(0,COUNTIF($A$1:A1,'BF End'!$W$2:$W$498)+('BF End'!$W$2:$W$498=""),0))),"")}

    I saw a formula in my search efforts that had a different "Match" block but I can't get it to work at the moment. The new formula was changed to:

    {=IFERROR(IFERROR(IFERROR(IFERROR(INDEX('BF Beginning'!$W$2:$W$500,MATCH(ROWS($A$1:A1)-1,COUNTIF($A$1:A1,'BF Beginning'!$W$2:$W$500)+('BF Beginning'!$W$2:$W$500=""),0)),INDEX(New!$X$2:$X$500,MATCH(ROWS($A$1:A1)-1,COUNTIF($A$1:A1,New!$X$2:$X$500)+(New!$X$2:$X$500=""),0))),INDEX('Closed or Transferred'!$Z$2:$Z$500,MATCH(ROWS($A$1:A1)-1,COUNTIF($A$1:A1,'Closed or Transferred'!$Z$2:$Z$500)+('Closed or Transferred'!$Z$2:$Z$500=""),0))),INDEX('BF End'!$W$2:$W$500,MATCH(ROWS($A$1:A1)-1,COUNTIF($A$1:A1,'BF End'!$W$2:$W$500)+('BF End'!$W$2:$W$500=""),0))),"")}

    Any suggestions?

    Thanks!

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Sorting an Array Formula

    Any suggestions?
    it'd be great if we had a chance to look at those formulas in your file

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

    Re: Sorting an Array Formula

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

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

    Re: Sorting an Array Formula

    @tim
    As the paperclip does not work anymore, it would be a good idea in the future to tell the OP to use the Go advanced - Manage attachments tool.
    Thanks

  5. #5
    Registered User
    Join Date
    09-04-2019
    Location
    Canada
    MS-Off Ver
    O365
    Posts
    9

    Re: Sorting an Array Formula

    Thank you Tim and Pepe! I've followed your directions and attached a sample of what I am trying to accomplish (Private data all over the place so the attachment is an extremely stripped down version).
    Attached Files Attached Files

  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,036

    Re: Sorting an Array Formula

    If I'm reading this correctly, you want an alphabetised, unique list from four separate columns (one per sheet). AFAIK, you can't do that without a helper column/Table, which can (of course) be hidden on another sheet. Is that OK?
    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 Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting an Array Formula

    Personally I'd bring all your data together into a single sheet, with an additional column to record the original sheet name.
    Then a simple Pivot Table along with a Slicer to filter any particular Supervisor name would give you all you want and avoid formulae altogether.

    Alternatively you could use Excel Power Pivot to join the separate tables together.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  8. #8
    Registered User
    Join Date
    09-04-2019
    Location
    Canada
    MS-Off Ver
    O365
    Posts
    9

    Re: Sorting an Array Formula

    Hello Glenn,

    I am perfectly ok with helper column/tables that can be hidden.

    Thanks,

    Quote Originally Posted by Glenn Kennedy View Post
    If I'm reading this correctly, you want an alphabetised, unique list from four separate columns (one per sheet). AFAIK, you can't do that without a helper column/Table, which can (of course) be hidden on another sheet. Is that OK?

  9. #9
    Registered User
    Join Date
    09-04-2019
    Location
    Canada
    MS-Off Ver
    O365
    Posts
    9

    Re: Sorting an Array Formula

    Thanks for the suggestion Richard! Although I 100% agree with you I cannot do the slicer option at the moment (I've tried...multiple times on various reports...I'm only a small fish in a large pond that resists change). I've never used Power Pivot but will try and explore that option this afternoon.

  10. #10
    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,036

    Re: Sorting an Array Formula

    I created 4 Named ranges (1 per source sheet) CTL-F3 to view /Edit, called List_1 to List_4. They look like this, and each are good for 1000 rows of data:

    =OFFSET('BF Beginning'!$B$2,,,SUMPRODUCT(--(LEN('BF Beginning'!$B$2:$B$1000)>0)))

    On sheet 1, I combined all unique values with this array formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I added a sort column in A2, copied down:

    =IF(B2="","",COUNTIF(Uniques,"<"&B2))

    and copied that lot down 80 rows. I set up a 5th Named Range (Uniques) using a similar formula, good for 100 rows:

    =OFFSET(Sheet1!$B$1,,,SUMPRODUCT(--(LEN(Sheet1!$B$1:$B$100)>0)))

    then on your summary sheet, a simple formula to alphabetise the names:

    =IFERROR(VLOOKUP(ROWS(A$2:A2),Sheet1!A:B,2,FALSE),"")

    The formulae in the next few columns can be simplified a bit, too. see the shaded cells
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-04-2019
    Location
    Canada
    MS-Off Ver
    O365
    Posts
    9

    Re: Sorting an Array Formula

    Thanks so much Glenn!! This was perfect. I noticed that when I substituted the actual data back in it was doing something funky with order count. I changed your sort column slightly and it worked perfectly with the data!

    The change I made was adding "=":

    =IF(B2="","",COUNTIF(Uniques,"<="&B2))

    Thanks again!!

+ 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. Sorting date with array formula
    By jbrooks1988 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-25-2016, 04:29 PM
  2. Implement sorting text cells using array formula in the current formula.
    By archangel9999 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-19-2014, 06:42 AM
  3. [SOLVED] Sorting with Array formula
    By mariannehislop in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-25-2014, 10:16 PM
  4. Sorting table with array formula
    By WoodyFan in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-17-2014, 08:28 AM
  5. [SOLVED] Sorting results from an array formula
    By dancing-shadow in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-17-2012, 06:17 PM
  6. array formula, sorting time and day of the week.
    By xatomicx in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-12-2012, 03:53 PM
  7. Sorting a CSE Array Formula
    By tbone90s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2009, 05:22 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