+ Reply to Thread
Results 1 to 6 of 6

List of values within a range

  1. #1
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    List of values within a range

    Tried searching on "List" but haven't found an answer to this query. Doesn't really seem to overlap the LIST function.

    Have records with non-consecutive numerical designations in one column. The numercial designations repeat so that for 10,000 records there might be 7 or 8 values reflected in that column. I can scroll through and jot down the 7 or 8 but is there a function that can query a range and return a comma separated list or a table of the distinct values in that range.

    So if the column looked like this:

    8
    8
    8
    8
    11
    11
    11
    11

    the function would return 8,11.

    Thanks,

    Brian
    Last edited by riwiseuse; 10-04-2010 at 09:46 AM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: List of values within a range

    I would create a simple uDF

    Please Login or Register  to view this content.
    and use that like so

    =GetUniques(A1:A200)

  3. #3
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: List of values within a range

    [QUOTE=Bob Phillips;2391821]I would create a simple uDF

    [code]

    Bob,

    must concede that the uDF thing is not too transparent for me. I used to make functions and macros in separate sheets writing the code in cells but ever since the Visual Basic Editor, I can't figure out how to make a function.

    It was probably supposed to make things better, but I'm lost. Can't find how you name the project or make it a function. It wasn't that that was so obvious with the old system but I had figured it out.

    Then I'd love to understand how your func tion actually accomplishes the goal.

    Meantime I came up with a workaround. I sorted the data by precinct number and I inserted a column next to the precinct column and if the precinct column were A, put in this formula in B2: =IF(A2=A3,0,A2) and then filled that formula down the entire column. So this will only put a value in the B column if the value in the next row is not the same. Then I sort on the B column and get a sorted list of precincts.

    Thanks for taking the time to respond,

    Brian

  4. #4
    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
    48,470

    Re: List of values within a range

    If you're OK with doing it manually, much quicker is to use an Advanced Filter and select unique entries and write it to a new area.

    See the attached picture.

    Regards
    Attached Images Attached Images
    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


  5. #5
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: List of values within a range

    TM - Who Knew. That advanced filter function is just what I was trying to accomplish. Thanks mucho.

    Bob, still glad of any feedback on the structure of your uDF and pointer to a primer on how to actually create, name and call uDFs easily.

    Thanks all, marking this solved.

    Brian

  6. #6
    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
    48,470

    Re: List of values within a range

    You're welcome. 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)

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