+ Reply to Thread
Results 1 to 10 of 10

Looking up values, and then enabling to choose from another list

  1. #1
    Registered User
    Join Date
    11-07-2020
    Location
    Croatia
    MS-Off Ver
    2010
    Posts
    5

    Looking up values, and then enabling to choose from another list

    Hello everyone,

    well I got a problem and after looking it up didn't find the solution online, so maybe someone can shed some light on it.

    Okay, so imagine a list of names (for example: John, Pete, Michael, Anthony). First I made a data validation cell (list type) so I get a cell with the drop-down selection of the values (names in the list). So that cell can have values of John, Pete, Michael or Anthony - whichever one I select from the drop-down menu.

    Then I make additional list cells for each of the names, with different values for each of them.

    For John: Football, Basketball, Sneakers
    For Pete: Football, hockey stick, Skates, bow
    For Michael: Volleyball, Diving gear, running shoes
    For Anthony: Sweatpants, Tennis ball, Ping pong paddle

    So here we get to what I need, and that is a function/macro for excel to check the name in a cell which contains the drop down list with names, and returns the value of the cell to be the drop-down list for that specific name.

    To explain further, I have a cell with the drop-down list of names (John, Pete, Michael, Anthony) in which I select one of them. Then the funcion/macro in another cell makes that cell become the drop-down list cell for that specific name, in which I can again select one of the values.

    For example, I select Pete in the first cell, and the second cell becomes the one with drop-menu options: Football, hockey stick, skates, bow.

    I made an excel file for someone who knows how to solve this to type in the equation/macro, and attached it, named "Excel help for forum".

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,086

    Re: Looking up values, and then enabling to choose from another list

    Welcome to the forum.

    Have a look at this tutorial: https://www.excel-easy.com/examples/...own-lists.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Looking up values, and then enabling to choose from another list

    Please watch this post.

    i have something for you.

    Ok i have defined two dynamic ranges in the Name Manager.

    I then used these Ranges in the Two Dropdown Boxes.

    Names =INDIRECT("Sheet2!A1:A" &MATCH("zzzzzz",Sheet2!A:A))

    Gear =OFFSET(Sheet2!A12,MATCH(Sheet1!$B$3,Sheet2!A:A,0)-1,1,1,MATCH("zzzz",INDIRECT("Sheet2!"&MATCH(Sheet1!$B$3,Sheet2!A:A,0)&":"&MATCH(Sheet1!$B$3,Sheet2!A:A,0)))-1)
    Attached Files Attached Files
    Last edited by mehmetcik; 11-07-2020 at 05:43 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    11-07-2020
    Location
    Croatia
    MS-Off Ver
    2010
    Posts
    5

    Re: Looking up values, and then enabling to choose from another list

    Well,

    tried it according to the first post, and it works (Thanks again ), but I got something more now. If I assign different numerical values to the gear of each name, for example:

    For John:
    Football - 15
    Basketball - 14
    Sneakers - 30

    For Pete:
    Football - 13
    Hockey stick - 8
    Skates - 44
    Bow - 35

    For Michael:
    Volleyball - 6
    Diving gear - 78
    Running shoes - 25

    For Anthony:
    Sweatpants - 55
    Tennis ball - 3
    Ping pong paddle - 5

    What would be the function/macro to get the numerical value in a cell according to equipment selected for a given name??

    For example, Name drop down cell: Michael -> Gear drop down cell: Diving gear -> The cell in question: 78

    Bearing in mind that selecting Football for John should yield a value of 15, while selecting a Football for Pete should yield a value of 13.

    Thanks again!
    Last edited by AliGW; 11-08-2020 at 03:39 AM. Reason: Redacted for legibility.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,084

    Re: Looking up values, and then enabling to choose from another list

    It depends on how your data are laid out!!

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  6. #6
    Registered User
    Join Date
    11-07-2020
    Location
    Croatia
    MS-Off Ver
    2010
    Posts
    5

    Re: Looking up values, and then enabling to choose from another list

    Sorry,

    attached is the sample workbook - so the cell next to the "NUMERICAL VALUE" where the question marks are should display a numerical value depending on what the "gear" selection is,
    and for a specific name (John football is 15, while Pete football is 13).

    Also, so that it is a number, which can be added, subtracted, etc. without any further commands.

    Is that possible?
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,084

    Re: Looking up values, and then enabling to choose from another list

    Before I do this... are you COMPLETELY sure that the named ranges for GEAR are returning the correct choices????

  8. #8
    Registered User
    Join Date
    11-07-2020
    Location
    Croatia
    MS-Off Ver
    2010
    Posts
    5

    Re: Looking up values, and then enabling to choose from another list

    Yeah, tried them all out and they are OK.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,084

    Re: Looking up values, and then enabling to choose from another list

    Whatever. The layout seems weird to me. It'll be hard to maintain, unless you label things clearly.

    Anyway:

    =INDEX(INDIRECT($F$17):Sheet2!$L$3:$L$7,MATCH(Sheet1!$F$19,INDIRECT(Sheet1!$F$17),0),2) in F21. Being in Croatia, you may need ; as the separator
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-07-2020
    Location
    Croatia
    MS-Off Ver
    2010
    Posts
    5

    Re: Looking up values, and then enabling to choose from another list

    Well tried out your formula, and it worked...

    Thanks again, everyone!

+ 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] Choose to List Box
    By Chandria in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-17-2017, 12:08 AM
  2. Replies: 5
    Last Post: 03-10-2016, 09:32 AM
  3. [SOLVED] Create a list according what i choose in A1!
    By apla in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-24-2013, 10:39 AM
  4. Function to Choose and List Values ignoring blanks and erros
    By k2i2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2013, 11:10 AM
  5. Can I make a drop down list to choose formats not values?
    By AhmedIsmail759 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2013, 04:35 AM
  6. Replies: 1
    Last Post: 05-17-2011, 08:44 PM
  7. Choose from List
    By NNothard in forum Excel General
    Replies: 4
    Last Post: 10-09-2006, 11:53 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