+ Reply to Thread
Results 1 to 6 of 6

Validation List Unique Values

  1. #1
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Validation List Unique Values

    Hi All,

    I have a named range called Customers. It dynamically picks up the list of customers. Problem is that I want my List to show each customer only once.

    Here is what the table looks like:

    Customer
    A
    A
    A
    A
    A
    A
    B
    B
    B
    B
    B
    B
    B
    C
    C
    C
    C
    C
    C


    I want the list to show only one A, B, C for it's selection options.

    Make sense?

    Any ideas?

    Regards,
    Matt

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Validation List Unique Values

    Why have you got duplicates in the list?usually validation is based on a list of unique entries,this can be on a separate sheet
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Re: Validation List Unique Values

    Hello royUK,

    Thank you for the reply.

    My data set has duplicate values because for each customer there are many variables. The data set changes all the time, it is not static, or a separate look up tab would be useful.

    Here is a better way to look at it:

    Customer Variable
    A Sales
    A FCST
    A ACD
    A DOI
    B Sales
    B FCST
    B ACD
    B DOI
    C Sales
    C FCST
    C ACD
    C DOI

    I would like the validation list to grab the unique list of the customers....right now it grabs all the customer, so 4 customer A's, 4 customer B's, etc.....

    Make sense or should I attach an example work sheet?

    Regards
    Matt

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Validation List Unique Values

    You can do this with formulas or a UDF and dynamic named range.

    For a formula-based approach, see http://www.get-digital-help.com/2009...array-formula/.

    If you want a UDF, holler.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Re: Validation List Unique Values

    Hello shg,

    Thanks for the suggestion. I was able to get most of the formula on the "get-digital" web site. Still struggling with part of it. The other problem is that is takes a long time to calculate with the several hundred rows that it needs to calculate.

    What is UDF? I don't recognize that term.

    Thanks,
    Matt

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Validation List Unique Values

    UDF - User Defined Function (VBA Function)

    The demo. illustrated by shg will be relatively expensive performance wise given use of Arrays in conjunction with Volatile Named Range construct (OFFSET)

    Using Post # 3 as an example such that A1:B13 contains:

    Please Login or Register  to view this content.
    another way of creating a (dynamic) unique listing in C would be to do the following:

    Please Login or Register  to view this content.
    the above tells us is one calc. how many unique customers we have.

    What we do next depends rather on whether or not the Customer ID's (Col A) are sorted alphabetically or not ?

    All the implications thus far are that, yes, the codes are sorted in which case:

    Please Login or Register  to view this content.
    You will note that surplus rows are populated with #N/A errors - this is deliberate and is to assist us in creating our Dynamic Named Range (DNR) for use in Validation... we thus create a DNR as follows:

    Please Login or Register  to view this content.
    We can now use this Name in a given cell as source for DV

    Please Login or Register  to view this content.

    If your Customer ID's are not sorted alphabetically then things will become a little more expensive formulae wise in terms of generating the unique listings ... when dealing with large volumes of data it is always wise to sort the data appropriately as this generally permits efficiency gains long-term.

+ 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