+ Reply to Thread
Results 1 to 6 of 6

Drop-down list formula

  1. #1
    Registered User
    Join Date
    11-16-2007
    Posts
    2

    Drop-down list formula

    Ok my first time here so ill start by saying hello. Now heres what I want to do. I want to use a drop-down list so you can select different types of wood. That part i got. what i cant figure out is how to use my drop-down selection in a formula. I want the user to be able to select the type of wood in the drop-down, this will in turn add a specific number to an equation. (ex: picking spruce will in turn add 30 to the equation). How can I do this?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    What's your formula now? and what would you like it to change to?

    Also, is there a pattern as to what the "number" should be based on the type of wood selected? ie..if the 1st item selected then 10, if 2nd item, then 20, if 3rd item then 30, etc...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    I assume you are using a data validation list for the drop-down? If so, let's assume the drop-down is in A2 and the list for the data validation is in B2:B10. In cells C2:C10, enter the corresponding values.

    Here is one way:

    In the formula, you can use INDEX/MATCH:

    =INDEX(C2:C10,MATCH(A2,B2:B10,0),1)

    HTH

    Jason

  4. #4
    Registered User
    Join Date
    03-17-2007
    Location
    India
    MS-Off Ver
    2003
    Posts
    18
    You should be able to use IF function to evaluate the value in the cell (The value you selected from drop down) and you should be able to achieve what you want to.

  5. #5
    Registered User
    Join Date
    11-16-2007
    Posts
    2
    NBVC: yes, each species of wood will have a different value. This formula is to calculate the dead loads in residential construction. what i want it to do is take the width x height x species value and give me the weight of the material.

    JASON: that sounds like it can work..let me try that

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,080
    Use a VLOOKUP. Have a table sorted by the name of the wood in column A, and the amount to add in column B.
    I used this table in D2:E6

    ash 1
    cedar 3
    elm 9
    oak 4
    spruce 2

    In the properties of your Drop Down box enter a cell in the Linked Cell property (I used B10)

    Then in D10 I put
    =VLOOKUP(B10,D2:E6,2)


    As I change the value in the Combo Box, ie the type of wood, the value in B10 changes and the corresponding numeric value in D10 changes too.

    Base your calculation on this
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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