+ Reply to Thread
Results 1 to 16 of 16

Alternative to a Pivot table to create a list

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Alternative to a Pivot table to create a list

    hi all,

    very simple i am sure but i just don't know the syntax.

    attached is a spreadsheet example; on the left hand side is a random list of names, i need to put these names in to a unique list, but i can not use a pivot table, as i need it to auto refresh and work with some other formulas.

    i dont need it to count, i literally need it to give me a list of unique names, as per the bottom right of the spreadsheet.

    any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Alternative to a Pivot table to create a list

    Try this, copied down...
    =IFERROR(INDEX($A$6:$A$35,MATCH(0,INDEX(COUNTIF($C$4:C4,$A$6:$A$35),0,0),0)),"")

    However, this will not sort for you, so if you really need it sorted, sort A 1st
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Alternative to a Pivot table to create a list

    copy past the data.

    Data => remove duplicated

    Data => sort A - Z

    will give the result.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    Quote Originally Posted by oeldere View Post
    copy past the data.

    Data => remove duplicated

    Data => sort A - Z

    will give the result.
    I need it automated, don't want human interaction involved at all.

  5. #5
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    Quote Originally Posted by FDibbins View Post
    Try this, copied down...
    =IFERROR(INDEX($A$6:$A$35,MATCH(0,INDEX(COUNTIF($C$4:C4,$A$6:$A$35),0,0),0)),"")

    However, this will not sort for you, so if you really need it sorted, sort A 1st
    Thank you FDibbins, however this only returned the first item in the list and none of the others.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Alternative to a Pivot table to create a list

    Hi.

    Put this formula in e.g. F20:

    =SUMPRODUCT(1/COUNTIF(A6:A35,A6:A35))

    This counts the expected number of returns and so, by referencing this value in the main set of formulas, we ensure that we control what is returned. What's more, it gives a far more efficient and less resource-heavy solution than the equivalent IFERROR set-up.

    Then enter this array formula** in E20:

    =IF(ROWS($1:1)>$F$20,"",INDEX($A$6:$A$35,MATCH(SMALL(IF(FREQUENCY(MATCH($A$6:$A$35,$A$6:$A$35,0),ROW($A$6:$A$35)-MIN(ROW($A$6:$A$35))+1),COUNTIF($A$6:$A$35,"<"&$A$6:$A$35)),ROWS($1:1)),COUNTIF($A$6:$A$35,"<"&$A$6:$A$35),0)))

    Copy this formula down (though not the one in F20, which is a one-off) until you start to get blanks for the results.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  7. #7
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    Quote Originally Posted by XOR LX View Post
    Hi.

    Put this formula in e.g. F20:

    =SUMPRODUCT(1/COUNTIF(A6:A35,A6:A35))

    This counts the expected number of returns and so, by referencing this value in the main set of formulas, we ensure that we control what is returned. What's more, it gives a far more efficient and less resource-heavy solution than the equivalent IFERROR set-up.

    Then enter this array formula** in E20:

    =IF(ROWS($1:1)>$F$20,"",INDEX($A$6:$A$35,MATCH(SMALL(IF(FREQUENCY(MATCH($A$6:$A$35,$A$6:$A$35,0),ROW($A$6:$A$35)-MIN(ROW($A$6:$A$35))+1),COUNTIF($A$6:$A$35,"<"&$A$6:$A$35)),ROWS($1:1)),COUNTIF($A$6:$A$35,"<"&$A$6:$A$35),0)))

    Copy this formula down (though not the one in F20, which is a one-off) until you start to get blanks for the results.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    EXCELLENT THANK YOU, however one problem, it stops if the cell is blank on the first formula, is their a way around this, as i can not populate the blanks in anyway?

    Otherwise it works correctly, thank you.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Alternative to a Pivot table to create a list

    Sorry - not sure what you mean? If which cell is blank? Do you mean your original list can potentially contain one or more blank cells?

    Regards

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Alternative to a Pivot table to create a list

    Quote Originally Posted by simbalyon303 View Post
    Thank you FDibbins, however this only returned the first item in the list and none of the others.
    Perhaps you didnt copy it in/down correctly?

    A
    B
    C
    5
    DRIVER NAME
    6
    ORANGE ORANGE
    7
    APPLE APPLE
    8
    PEAR PEAR
    9
    GRAPES GRAPES
    10
    MELON MELON
    11
    BANNANA BANNANA
    12
    KIWI KIWI
    13
    STRAWBERRY STRAWBERRY
    14
    GRAPEFRUIT GRAPEFRUIT
    15
    KIWI
    16
    KIWI
    17
    GRAPEFRUIT
    18
    GRAPEFRUIT


    C6=IFERROR(INDEX($A$6:$A$35,MATCH(0,INDEX(COUNTIF($C$5:C5,$A$6:$A$35),0,0),0)),"")

  10. #10
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    yes my original list contains blanks. so the first formula you use for some reason ends up giving me a div error:


    STRAWBERRY #DIV/0!
    ORANGE #DIV/0!
    GRAPES #DIV/0!
    MELON #DIV/0!
    STRAWBERRY #DIV/0!
    ORANGE #DIV/0!
    #DIV/0!
    GRAPES #DIV/0!
    GRAPEFRUIT #DIV/0!
    MELON
    STRAWBERRY
    MELON
    STRAWBERRY
    ORANGE


    as apposed to:

    STRAWBERRY 9
    ORANGE APPLE
    GRAPES BANNANA
    MELON GRAPEFRUIT
    STRAWBERRY GRAPES
    ORANGE KIWI
    GRAPEFRUIT MELON
    GRAPES ORANGE
    GRAPEFRUIT PEAR
    MELON
    STRAWBERRY
    MELON
    STRAWBERRY
    ORANGE

  11. #11
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    xor lx,

    yes my original list contains blanks. so the first formula you use for some reason ends up giving me a div error:


    STRAWBERRY #DIV/0!
    ORANGE #DIV/0!
    GRAPES #DIV/0!
    MELON #DIV/0!
    STRAWBERRY #DIV/0!
    ORANGE #DIV/0!
    #DIV/0!
    GRAPES #DIV/0!
    GRAPEFRUIT #DIV/0!
    MELON
    STRAWBERRY
    MELON
    STRAWBERRY
    ORANGE


    as apposed to:

    STRAWBERRY 9
    ORANGE APPLE
    GRAPES BANNANA
    MELON GRAPEFRUIT
    STRAWBERRY GRAPES
    ORANGE KIWI
    GRAPEFRUIT MELON
    GRAPES ORANGE
    GRAPEFRUIT PEAR
    MELON
    STRAWBERRY
    MELON
    STRAWBERRY
    ORANGE

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Alternative to a Pivot table to create a list

    It's not "for some reason": your example included no such cells, so I did not account for that possibility. I can only work with what you give me.

    Change the formula in F20 to:

    =SUMPRODUCT((A6:A35<>"")/COUNTIF(A6:A35,A6:A35&""))

    And that in E20 to:

    =IF(ROWS($1:1)>$F$20,"",INDEX($A$6:$A$35,MATCH(SMALL(IF(FREQUENCY(IF($A$6:$A$35<>"",MATCH($A$6:$A$35,$A$6:$A$35,0)),ROW($A$6:$A$35)-MIN(ROW($A$6:$A$35))+1),COUNTIF($A$6:$A$35,"<"&$A$6:$A$35)),ROWS($1:1)),COUNTIF($A$6:$A$35,"<"&$A$6:$A$35),0)))

    Regards

  13. #13
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Alternative to a Pivot table to create a list

    Reply to #4.

    I need it automated, don't want human interaction involved at all.

    Record the manual actions with the macro-recorder and you have your VBA code.

  14. #14
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    Quote Originally Posted by FDibbins View Post
    Perhaps you didnt copy it in/down correctly?

    A
    B
    C
    5
    DRIVER NAME
    6
    ORANGE ORANGE
    7
    APPLE APPLE
    8
    PEAR PEAR
    9
    GRAPES GRAPES
    10
    MELON MELON
    11
    BANNANA BANNANA
    12
    KIWI KIWI
    13
    STRAWBERRY STRAWBERRY
    14
    GRAPEFRUIT GRAPEFRUIT
    15
    KIWI
    16
    KIWI
    17
    GRAPEFRUIT
    18
    GRAPEFRUIT


    C6=IFERROR(INDEX($A$6:$A$35,MATCH(0,INDEX(COUNTIF($C$5:C5,$A$6:$A$35),0,0),0)),"")
    fdippins, yours is working well now, thank you.

    is their a way to use your method, that then auto sorts alphabetically as well?

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Alternative to a Pivot table to create a list

    hmm ok try this, from 1 of the other members...
    =IFERROR(INDEX($A$6:$A$35,MATCH(0,COUNTIF($A$6:$A$35,"<"&$A$6:$A$35)-SUM(COUNTIF($A$6:$A$35,D$6:D6)),0)),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

  16. #16
    Registered User
    Join Date
    09-21-2011
    Location
    Hampshire
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Alternative to a Pivot table to create a list

    thank you all, much appreciated.

+ 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] How to create groups in pivot table drop down list
    By garciae2 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-08-2013, 10:42 AM
  2. Create List from Pivot Table
    By JoeyGirl in forum Excel General
    Replies: 7
    Last Post: 02-26-2010, 01:21 AM
  3. Create a list from Pivot table field rows
    By sayeamans in forum Excel General
    Replies: 3
    Last Post: 12-04-2009, 09:34 AM
  4. Alternative to Pivot Table
    By papaexcel in forum Excel General
    Replies: 16
    Last Post: 07-01-2009, 04:18 PM
  5. Create custom list from pivot table
    By Onestopfanshop in forum Excel General
    Replies: 1
    Last Post: 06-24-2009, 03:58 PM

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