+ Reply to Thread
Results 1 to 4 of 4

Adding results from dropdown list

  1. #1
    Registered User
    Join Date
    12-23-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    37

    Adding results from dropdown list

    I have the following formula running which enters a number based on the selection from a dropdown list in cell C24, which works fine:
    =IF(C24="",0,IF(C24="Green",115,IF(C24="Red",135,IF(C24="Blue",160,IF(C24="Yellow",180,IF(C24="Orange",120))))))

    However I would also like to subject this formula to the results of a second dropdown list, which will include a factor to be applied to each of the colour options, which is based on location. I have a list of about 6 locations, with factors ranging from 0.8 to 1.2. So for instance, if I was to select Green and the location with a factor of 0.8, it would multiply 115 x 0.8. Or if I was to select Yellow and the location with a factor of 1.2, it would multiply 180 x 1.2.

    The second dropdown list does not include the multiplication factor, just the location name. The location factors are situated in the column next to the source for the dropdown list.

    Any ideas on how I could pull this all together in one formula please?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Adding results from dropdown list

    First of all, you can reduce the length of your existing formula by setting up a small table somewhere and using the VLOOKUP function. The table would look like this:

    Green ……. 115
    Red …..…...135
    Blue ……... 160
    Yellow …… 180
    Orange …. 120

    and suppose you put that in cells X1:Y5, then you formula above would become:

    =IFERROR(VLOOKUP(C24,$X$1:$Y$5,2,0),0)

    You might already have the colours listed somewhere to drive your drop-down, so you could make that the basis of your table and change the second parameter to suit.

    So, extending this further, you could have a list of locations (which you might have for your second drop-down), and against each of them you could have the factor that applies. You can use another VLOOKUP function to retrieve the appropriate factor. To combine them you would just need to do this:

    =IFERROR(VLOOKUP(C24,$X$1:$Y$5,2,0) * VLOOKUP(cell2,table2,2,0),0)

    where cell2 is the cell for your second drop-down and table2 is the range where your second table is located (as you didn't give details of these).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-23-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    37

    Re: Adding results from dropdown list

    Fantastic, that's solved it! Thanks very much Pete_UK.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Adding results from dropdown list

    Glad to help - thanks for the rep.

    Pete

+ 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. Adding dates and names to dropdown list
    By e0263817 in forum Excel General
    Replies: 1
    Last Post: 09-29-2015, 10:39 AM
  2. Limit DropDown List Results Based on Other Data
    By marcelkahn5 in forum Excel General
    Replies: 5
    Last Post: 08-20-2015, 01:24 AM
  3. Replies: 3
    Last Post: 10-30-2013, 09:18 AM
  4. Adding a dropdown list of names
    By AdamHaubert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-10-2013, 10:54 AM
  5. Enter code into a dropdown list, bring back results
    By thedon_1 in forum Excel General
    Replies: 1
    Last Post: 12-10-2012, 06:10 AM
  6. [SOLVED] IF: Create dropdown list with multiple results from search data
    By arneld in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2012, 08:29 PM
  7. Replies: 4
    Last Post: 02-14-2012, 04:56 PM

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