+ Reply to Thread
Results 1 to 9 of 9

A formula that creates an alphabetically ordered list using unique values from a range

  1. #1
    Registered User
    Join Date
    06-08-2017
    Location
    London,England
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Question A formula that creates an alphabetically ordered list using unique values from a range

    I've been using Google Sheets for while and had a code that does this. Decided I wanted to move over due to issues with speed.

    Heres that code I used : =unique(sort(TRANSPOSE(filter('Champions Played Sheet'!$C$4:$AV,'Champions Played Sheet'!$B$4:$B=C3)),1,true))

    This sorted my values from a seperate sheet, transposed them from a column, listing them into a row while extracting the unique values from it.

    Now I have seen multiple videos on how to try and do it but it never seems to be functional for me in which ever method I try.

    Heres an example of a formula I tried:

    =INDEX('Champions Played Sheet'!C5:AR5,MATCH(MIN(IF(COUNTIF($B$1:B1,'Champions Played Sheet'!C5:AR5)=0,1,MAX((COUNTIF('Champions Played Sheet'!C5:AR5,"<"&'Champions Played Sheet'!C5:AR5)+1)*2))*(COUNTIF('Champions Played Sheet'!C5:AR5,"<"&'Champions Played Sheet'!C5:AR5)+1)),COUNTIF('Champions Played Sheet'!C5:AR5,"<"&'Champions Played Sheet'!C5:AR5)+1,0))

    This came up with #NA where im trying to list words and not doing what I want. I dont know if this is due to the videos being based on earlier version of the software or im doing something wrong.

    To mention, I am using a range from a column, not a row, and im getting the values from a seperate sheet (you guys can probably tell).

    Can someone send me the right away in terms of videos or advice, or demonstrate what im doing wrong so I can learn? Pretty much a beginner here


    Thanks
    Last edited by Roz3y; 06-08-2017 at 03:06 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    That formula needs:

    1) to have all the C5:AR5 changed to $C$5:$AR$5

    2) to be Array-Entered using Ctrl-Shift-Enter

    3) to be in cell B1, and then copied down.

    4) to not have any blanks in C5:AR5


    This version needs to be array-entered in cell A2, and copied across (to transpose the unique values starting in C5 down to C45) :

    =IFERROR(INDEX('Other sheet name'!$C$5:$C$45,MATCH(MIN(IF(COUNTIF($A$2:A2,'Other sheet name'!$C$5:$C$45)=0,1,MAX((COUNTIF('Other sheet name'!$C$5:$C$45,"<"&'Other sheet name'!$C$5:$C$45)+1)*2))*(COUNTIF('Other sheet name'!$C$5:$C$45,"<"&'Other sheet name'!$C$5:$C$45)+1)),COUNTIF('Other sheet name'!$C$5:$C$45,"<"&'Other sheet name'!$C$5:$C$45)+1,0)),"")


    It does not reliably return the values in alphabetical order - not sure why.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-08-2017
    Location
    London,England
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    Hi sorry for the late reply, have not been at the computer for a while due to issues that dont need to be shared on here.

    I've tried doing what you said but all i get is the first value in that range of cells im taking it from. Heres the excel formula i created from your guidance.

    =IFERROR(INDEX('Champions Played Sheet'!$C$5:$AR$5,MATCH(MIN(IF(COUNTIF(Sheet1!$A$3:A3,'Champions Played Sheet'!$C$5)=0,1,MAX((COUNTIF('Champions Played Sheet'!$C$5:$AR$5,"<"&'Champions Played Sheet'!$C$5:$AR$5)+1)*2))*(COUNTIF('Champions Played Sheet'!$C$5:$AR$5,"<"&'Champions Played Sheet'!$C$5:$AR$5)+1)),COUNTIF('Champions Played Sheet'!$C$5:$AR$5,"<"&'Champions Played Sheet'!$C$5:$AR$5)+1,0)),"")

    I array entered it in so its a little bizarre. The only difference i can see is that im getting my range from list in a row, not a list in a column. I'm unsure really of where i need to go. The only part im a little confused with is the part i have bolded on the formula. Does this need to be the same as cell im putting the formula in or the cell next to it.

    At this point, im not too bothered if it's alphabetical. Im just a sucker for a little bit of organization

    Thanks again
    Last edited by Roz3y; 06-12-2017 at 12:48 PM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    You had posted - "transposed them from a column, listing them into a row"

    So that was how I wrote the formula.

    Now you say "my range from list in a row"

    So, is your original data in a row, or a column, and do you want it in a row or a column?

  5. #5
    Registered User
    Join Date
    06-08-2017
    Location
    London,England
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    Yeah, dont ask me how i did, but somehow got myself confused with the rows and columns.

    My list is in a row, but i want it to be a columned list. If that is possible?

    Sorry for the confusion

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    I cannot find a stable single-column function-only solution that will transpose and sort consistently.

    With a user-defined function in VBA, though, this is stable:

    =Row2ColUA('Champions Played Sheet'!$C$5:$AR$5,ROW(A1))

    copied down.

    Place this code into a standard module and save the file as a macro-enabled .xlsm


    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-08-2017
    Location
    London,England
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    Hey, thanks again for the help. Im coming up with a "Compile error: User-defined type not defined".

    Im pretty new to all the VBA stuff so i have none to basic knowledge on how it works.

    Is there any settings I need to apply so the VBA will work properly. Thanks again

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    Sorry - I forgot to add that the code requires a reference to MS scripting Runtime. In your Visual Basic Editor, choose Tools / References.. and then scroll down to find that file and put a check mark next to it:


    Capture.JPG

  9. #9
    Registered User
    Join Date
    06-08-2017
    Location
    London,England
    MS-Off Ver
    MS Office 2013
    Posts
    5

    Re: A formula that creates an alphabetically ordered list using unique values from a range

    Thank you so much. That works perfectly now. Appreciate it so much

+ 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] Formula to get unique and alphabetically sorted list after matching a criteria
    By Saranya A in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-20-2016, 06:50 AM
  2. [SOLVED] Dynamic Formula for Getting Unique Items from a list and sort them alphabetically
    By tuckertheguy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-18-2015, 03:57 AM
  3. [SOLVED] Formula to extract unique values from two excel tabs and sort alphabetically
    By rshukla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2013, 01:48 PM
  4. Counting Unique Values and Generating an Ordered List
    By amerain in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2013, 08:08 PM
  5. [SOLVED] Unique distinct alphabetically sorted list
    By atlant15 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2013, 10:03 AM
  6. Formula to list unique values in a range
    By CormacM in forum Excel General
    Replies: 2
    Last Post: 03-20-2012, 10:57 AM
  7. Return Ordered Unique Values Function
    By JSimone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 12:51 AM

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