+ Reply to Thread
Results 1 to 12 of 12

'dynamic' drop down

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    'dynamic' drop down

    Dear forum.
    I was wondering if anyone can help me with manipulating the formulas in the attached sample workbook.
    In the workbook there are two sheets with formulas I found on the web. Sheet 1 is as per the website and works well for what I want except for the location where the formula is. Sheet 2 is the same except I have moved where the formula are entered, and it no longer works.
    There are 2 sets of formulas. (a) In the cells (N10:N21) on sheet 2 and (b) in the Data Validation 'Source'.
    Any insight would be appreciated.
    Attached Files Attached Files
    Last edited by Cidona; 08-17-2011 at 10:31 AM. Reason: Marked as Solved

  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: 'dynamic' drop down

    You need to better explain what you are trying to achieve, that data makes no obvious sense.

  3. #3
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: 'dynamic' drop down

    Sorry Bob.
    What I am trying to do is be able to use Data Validation (in cell G7). In colum A there are a bunch of names, some of them used more than once. In cell G7 I want a drop down of these names, however I only want each name to be available once in the data validation cell (I am antisapating using this on a large list where manufacture names will have hundreds of entries. If each manufacturer (name) was available for each record it would require considerable scrolling in the data validation cell).
    Column B on sheet 1 has formulas (that I found on the web), that looks at the names in colum A and will only list each name once. Cell G7 then looks at this list for the available items for the data validation, thereby allowing each name to only be available once in the data validation cell (G7).
    Problem is when the formulas are moved as on Sheet 2.
    Any ideas?

  4. #4
    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: 'dynamic' drop down

    Change the formula in Sheet1!B1 to

    =IF(SUMPRODUCT(--(LEN($B$1:$B1)>0))=SUMPRODUCT(($A$1:$A$20<>"")/COUNTIF($A$1:$A$20,$A$1:$A$20&"")),"",OFFSET($A$1,MATCH(0,MMULT(--TRANSPOSE(TRANSPOSE($A$1:$A$13)=B$1:B1),ROW(INDIRECT("1:"&ROW()-1))/ROW(INDIRECT("1:"&ROW()-1))),0)-1,0,1,1))

    and copy down.

    Use Formulas>Defined Names>NameManager to create a defined name, say called namesList with a RefersTo formula of

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

    Then in the Data Validation on Sheet2, use a formula of

    =namesList

  5. #5
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: 'dynamic' drop down

    Thanks Bob, however when I copy the formula into Sheet1!B1 i get '0' in all the cells that I copied the formula into.
    Any ideas?

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: 'dynamic' drop down

    Hi Cidona,

    I think you need to learn Advanced Filters where the Unique check box is used. You would build a unique list of data for your drop down. You could then Dynamic Name Range this filtered list of unique data if needed.

    See attached.

    If your list is dynamic you could write some VBA event code to update the advanced filtered data and even sort it. But - I think the start to you problem is to create the Advanced Filter with unique values.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    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: 'dynamic' drop down

    Quote Originally Posted by Cidona View Post
    Thanks Bob, however when I copy the formula into Sheet1!B1 i get '0' in all the cells that I copied the formula into.
    Any ideas?
    You need to array-enter it.

  8. #8
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: 'dynamic' drop down

    Marvin,
    I'm sure in the right hands the advanced filter you mention could do it, however I will have to check that out another time. Was really looking for a quick fix based on the formula I posted which seems to have what I want but just needs tweeking.

    Bob, I have entered that as an array (ctrl+shift+enter) and it put the curvy brackets in the formula, however it is still replying '0' in all the cells.

  9. #9
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: 'dynamic' drop down

    Hi Cidona,

    I have a used separate sheet to get the unique names from Sheet1 A:A. Then used this in G7 data validation. Copy formula in down Sheet2 how many you needed, then you can hide Sheet2 if you need. See the attached.
    Attached Files Attached Files
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  10. #10
    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: 'dynamic' drop down

    Here is your workbook with that formula working
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: 'dynamic' drop down

    That works great Haseeb. Thank you!!

    Thank you again Bob and Marvin, I'm sure we'd have gotten your methods working also, but Haseebs is allowing me (novice user) to get there 'out of the box'.

    Thanks again.

  12. #12
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: 'dynamic' drop down

    Bob,

    You had posted with the working workbook inbetween my seeing Haseeb's reply and your posting.
    Your method is working also, so thank you very much for the working formula.

+ 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