+ Reply to Thread
Results 1 to 31 of 31

Referencing one list from another...

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Referencing one list from another...

    Found this example here on Excel Forum, and it does pretty much what I need it to do.
    I would like to revise the values to fit my needs.

    I have several options in one list, call it MASTER.
    When I pick Item A from the MASTER, I want to show all available options for that Item A in another list, called OPTIONS.
    I have 10 Items, and they all have a variation of 6 different options, some Items have 1 option, some have all 6.

    Anyway, the worksheet I found is attached, but cannot figure out how this is working.

    What am I missing here?
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    It's a couple of tools working together.

    Named references, found under Formulas->Name Manager defines a range with word. You could highlight D1:D50 on page, and in the upper left corner type bob in the "name field" and you could then forever call D1:D50 with the word bob. If D1:D50 was all 2's, then SUM(bob) would be 100.

    namedrange.png

    The lists in H3:H4, J3:J6, and L3:L5 are named ranges, named after their header; Produce, Fruit, Vegetable.

    The cells in A:A are using Data Validation, found in Data->Data Validation, with the List option, and the named ranges for the source. In this case, the lists in A are sourced to =Product.

    The validation in column B uses INDIRECT(whatever is in corresponding column A) to pull the word and convert the string to an indirect reference so that Excel evaluates it as more than just a word. It then recognizes Fruit or Vegetable as one of the named ranges, and displays its corresponding list.

    INDIRECT() took me a while to get around, but it has some great uses. If E10 simply had H1:H5 in it and you put SUM(E10) you would it would get a zero because it's evaluating the cell as text. But SUM(INDIRECT(E10)) would look at the contents of E10 and re-evaluate its contents as an actual range.
    Last edited by daffodil11; 10-23-2013 at 01:14 PM.

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    Note that all items in the drop down list in column A are in the list called Produce. Both items in the Produce list have their own lists with the names that are in the Produce list namely Fruit and Vegetable.

    If FRUIT is chosen in the drop down list in column A then the drop down list in column B draws its contents from the FRUIT list.

    If VEGETABLE is chosen in the drop down list in column A then the drop down list in column B draws its contents from the VEGETABLE list.

    Click in column A then click on the Data tab, Data Validation and see how the list was assigned to the drop down.

    Do the same for column B.

    If you have 10 items in the MASTER and each of those items has 6 options, you will have 10 lists to be created 1 for each item in the master list named according to the item in the master list.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    This will work, I never have used this INDIRECT function before.
    My issue now is that I am getting an error in DATA VALIDATION.
    My values in MASTER contain spaces, and it appears that I cannot make a list with spaces in list name...
    Underscores or dashes in the MASTER name is not really an option.
    These values are for display only and no other calculation or reference will be made from the returned values.
    Make sense?
    Any ideas on this issue?

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    This change will allow you to use entries with spaces.

    The use of tables is an easy way to have dynamic ranges. To add items to each table, click in the last cell of the table and hit the TAB key to create a new line in the table. Enter your data and that is automatically entered in the drop down list.
    Attached Files Attached Files
    Last edited by newdoverman; 10-23-2013 at 04:43 PM.

  6. #6
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    This worked really well.
    I not only learned about TABLES and dynamic ranges, but INDIRECT statements as well.

    Thanks newdoverman.

  7. #7
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    I successfully created the tables and lists in my MAIN workbook on the LISTS sheet and everything works fine.
    The problem I am having now is copying the Drop Downs from the LISTS sheet to the PRICING sheet in the MAIN workbook.
    All the other data, tables and lists will stay on the LISTS sheet.
    The cell referencing the table data is not responding with the any corresponding data in the cell to its right.

    When I attempt to revise the INDIRECT statement to reference the specific location of the data, I am getting Data Validation Errors.
    I can create a new sheet in the Drop Down Lists Example book and copy the drop downs to any cell on Sheet2 in that book and it works fine.
    What am I doing wrong here?
    Do you need to look at the book I am working on?

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    A look at the workbook would help. There are quite a few variables in the moving of tables and drop down lists. All of the names associated with the tables may have reference errors caused by the move....have to see to make sure.

  9. #9
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    Ok, here is a stripped out version of what I need to do.
    I want to move the dropdowns to PRICING A1 & A2...

    I worked on this for a while but just could not figure out what I am doing wrong.
    Attached Files Attached Files

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    Here is a version that I think works properly as far as my testing showed. I changed the first drop down to be Paints and Stains. From there the second drop down is dependent upon the choice of the first drop down and it gives the type of Paint or Stain. I added a third drop down that is dependent upon the second drop down and gives the details of the Paint or Stain type choice.

    I also removed the spaces from the tables as they do little other than make the lists longer than they should be. In addition, the spaces at the bottom of the tables didn't agree with the named ranges so they had to be brought into agreement.

    I also deleted all names in the Name Manager that no longer were valid.

    I hope that this arrangement works for you.
    Attached Files Attached Files

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    Oops, I forgot the requirement to move the drop down lists. This has been corrected:
    Attached Files Attached Files

  12. #12
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    I'm still having issues with the reverse engineering. I can't get Buttercreme's dependants to work.

    What role does OFFSET(FINISHES_CALC!$I$6,0,0,COUNTA(FINISHES_CALC!$I$6:$I$50),1) play? I am unable to find its reference.

    When attempting to use the named ranges on the first sheet, many of them do not appear to be available. Merlot shows up just fine, but Barn_Red doesn't appear in the function list when typing it.

    Edit: I figured out what was creating issues with both example. Most of names are defined in the Name Manager as only being scoped to the 2nd tab. Each of them justs needs adjusted to apply to the whole workbook.
    Last edited by daffodil11; 10-24-2013 at 04:36 PM. Reason: SCOPE!

  13. #13
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    I think this arrangement will be fine, actually better due to the specific pricing of either stain or paint finishes.
    However, the 3rd drop down list (glazes) moved to the other sheet does not work for me....
    It has to be something simple, as it does actually work for a couple selections... (Toffee & Merlot for Stains and Olive for Paints).

    Apologies for all the back and forth on this one.

  14. #14
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    It's the defined names. You'll need to open the Name Manager and delete all the defined names that are only scoped to FINISHES_CALC and then recreate them with a Scope of Workbook.

  15. #15
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    Not sure what that OFFSET is doing there...
    I believe that can be purged.

    How do I adjust the scope to include the whole workbook?

  16. #16
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    Go to Formulas Tab -> Name Manager

    You'll need to kill the bad ones and then just redefine them with the New.. button and make sure you select Workbook as the scope. (It's an option while you're selecting the data)

    defined names.png

  17. #17
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    Are these problems with the workbook that I uploaded or are they problems with another workbook? I've gotten a bit lost in the conversation.

    Can you post what you are having problems with?

  18. #18
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    It's both. Most of the named ranges only exist on the second tab. They just need purged from the name manager and recreated.

  19. #19
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    I see where I messed up... This is working now... so far..
    Thanks!

  20. #20
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    Named ranges were scoped to worksheet rather than workbook... My bad there...
    Learning alot with this one!
    Thanks all, will post as solved in the morning if all goes well.
    KD

  21. #21
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    Me too. The Data Validation lists being keyed to Tables is a real keeper for me.

    It makes a few hundred posts obsolete of people using OFFSET, COUNTIF, and arrays to prevent contingent dropdowns from having blanks.

    Great post, newdoverman.

  22. #22
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    This should work:
    Attached Files Attached Files

  23. #23
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    About the question about "OFFSET(FINISHES_CALC!$I$6,0,0,COUNTA(FINISHES_CALC!$I$6:$I$50),1)" This is used to create a dynamic list. It in effect defines a range by starting in $I$6 and the offset is zero rows, zero columns but the height is the count of cells that are not empty inside the range $I$6 to $I$50. That means that whatever the COUNTA value is, is the number of rows in the range. The 1 at the end is the width of the range in columns.

  24. #24
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    That did it, once I purged all the incorrect scoped named ranges, and reapplied the proper reference, it worked just great!
    I will definitely keep my eye on this, and will use this table format more in the future.
    One question for newdoverman...
    I am not quite clear on this OFFSET thing...
    Where and how is this formula used in the sheet specifically?

    I appreciate all you guys input on this one.
    Great job!
    KD

    BTW... How do I submit this as <SOLVED>?

  25. #25
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    OFFSET returns a value from a known cell that is a certain number of rows and columns away. As an experiment, enter a number in A10 on a worksheet that you can experiment on. Now, in another cell (anywhere) enter this formula =OFFSET(A1,9,0,1,1) The value that you entered in A10 should be returned. What the formula says is something like this. Starting in A1 count down 9 rows, stay in the same column and return the value in the range 1 row high and 1 column wide. This formula can be shortened down to =OFFSET(A1,9,0) as the height and width of the reference are not relevant in this case.

    Now, with the same value in A10 enter this formula in another cell =OFFSET(B20,-10,-1) This means to start at cell B20, go up 10 rows and to the left 1 column.

    =OFFSET($I$6,0,0,COUNTA($I$6:$I$50),1) This form of the OFFSET is used to create dynamic ranges. That is, ranges of varying length which is useful with creating drop down lists and you don't want a big space at the bottom of the list or you want the drop down list to expand when new items are added to it without having to change the cell references to the range in the Name Manager. This formula says to start at $I$6 (a fixed cell),don't move any rows or columns, (the two zeros) but make the range the size of the count of cells that are not empty and keep the range 1 column wide. The range specified in the COUNTA part puts a limit on the amount of data that can be entered in the list without having to re-define the list range. If there was going to be more than 50 items the 50 could be any number that would be sufficient to satisfy you.

  26. #26
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    Quote Originally Posted by kevindowney View Post
    Where ...is this formula used in the sheet specifically?
    I still can't find which cell the OFFSET is actually being used in.

  27. #27
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    OFFSET has been eliminated from the worksheet by the use of the tables. (as far as I can remember) When using tables, the OFFSET command becomes rather unnecessary. The original file posted in this thread, is an example file that I uploaded in another thread. The OFFSET may have been in that file, I don't know for sure.

    I did discover that there were several names in the Name Manager that were carry-overs that didn't belong, from other projects that I worked on. This may have been the source. How those names got into this project, I don't know....I deleted them when I went through the names in the Name Manager.

  28. #28
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Referencing one list from another...

    Thanks for clearing that up.

  29. #29
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    yeah, that's what I was thinking... OFFSET is not used in this case.
    I purged all the unused names in my workbook as well.
    I also added another option to the finishes...No Finish.
    And it actually worked!

  30. #30
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Referencing one list from another...

    Good, you're getting the "hang" of it

  31. #31
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Referencing one list from another...

    I have another question now that I have solved this last one...
    Will start a new thread.

+ 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. Replies: 12
    Last Post: 10-17-2012, 08:12 AM
  2. Categorizing a List of Words by Referencing Another List of Phrases
    By samebito in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2012, 02:26 PM
  3. List Referencing
    By Stretch617 in forum Excel General
    Replies: 2
    Last Post: 10-21-2008, 12:41 PM
  4. Combo Box List Referencing
    By Gus80 in forum Excel General
    Replies: 2
    Last Post: 05-22-2008, 06:31 PM
  5. If referencing drop-down list
    By Nicole Seibert in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-21-2006, 09:40 AM

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