+ Reply to Thread
Results 1 to 5 of 5

Auto fill cell based on Drop Down List not working

  1. #1
    Registered User
    Join Date
    04-11-2014
    Location
    Australia
    MS-Off Ver
    Excel 2011 iOS
    Posts
    2

    Auto fill cell based on Drop Down List not working

    Hi there!

    I've been trying this for hours but nothing has worked yet. I tried vlookup, index+match+left , if functions, all unsuccessfully.

    I have 2 problems and I've attached a file to be easier to understand.

    Problem 1: I need to auto fill a cell based on a selection of a drop down list and on a list on another sheet. But I only need some characters of what is displayed on the drop down option.

    e.g. I need to fill the green cell (W6) on 'Sheet1' based on the selections of the drop down (blue cell). If I select the first option '123 Chocolate 456 Strawberry' I want it to select only '123' and look for that reference on another list (on Sheet2) and bring the result of the cell next to it.

    Meaning: I want it to look for '123' on the list on Sheet2 but to appear '0,239' on the green cell.


    Problem 2: I need to fill the red cell with a variation of a section of a selection on the drop down list (blue cell).

    e.g. If I select '123 Chocolate 456 Strawberry' on the drop down, I want to to look for only '456' in that text and display it as 0.456 in the red cell. The problem is that not all numbers have 3 characters.



    I would appreciated any help as I've spent way too much time on this already.

    Thanks!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-28-2014
    Location
    Hertford, England
    MS-Off Ver
    Excel 2010,2013
    Posts
    38

    Re: Auto fill cell based on Drop Down List not working

    Hi, I answered a similar question recently HERE

    hopefully this is a starting point

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Auto fill cell based on Drop Down List not working

    See if this works for you
    Green
    =VLOOKUP(LEFT(W4,FIND(" ",W4)-1)+0,Sheet2!$A$8:$B$10,2,FALSE)
    Red
    =TRIM(MID(W4,MinNumPos,3))
    where MinNumPos is a defined name
    =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},Sheet1!$W$4&1234567890,5))
    With the second, not sure if you wanted 78 (for example) to be 0.78 or 0.078?
    If second, then
    =TRIM(MID(W4,MinNumPos,3))/1000
    If first, then
    ="0."&TRIM(MID(W4,MinNumPos,3))
    Does this work for you?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    04-11-2014
    Location
    Australia
    MS-Off Ver
    Excel 2011 iOS
    Posts
    2

    Re: Auto fill cell based on Drop Down List not working

    Hi ChemistB!

    Thank you so much for your reply! Your tips work wonderfully on the example, but not quite on my real spreadsheet :/

    Some things I noticed are different:

    1) I renamed my W4 cell, which is a merged cell and is the drop down list, to DropDown. Whenever I try the first formula it comes up a #VALUE error, and when I trace it, it highlights the DropDown cell and the list on Sheet2. I noticed there's a letter right next to the 3 numbers. Could this be it? Because I tried it on the example (after I updated it to be more accurate) and it happens the same thing.

    2) the formula for the green cell works wonders for 3 numbers, but when I select the option with only 2 numbers it also comes up a #VALUE error. I believe is because there's a letter right next to the 2 numbers.

    I've attached a more accurate example of what is going on and would really appreciate your help.

    Thanks thanks thanks!
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Auto fill cell based on Drop Down List not working

    Okay, had to add a few more Defined names

    FrstNumPos = position of last digit in the first series of numbers
    =MAX(IF(ISERROR(SEARCH({0,1,2,3,4,5,6,7,8,9},Sheet1!$W$4)),"",SEARCH({0,1,2,3,4,5,6,7,8,9},Sheet1!$W$4)))

    MinNumPos = position of the first digit in the second series of numbers
    =MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},Sheet1!$W$4&1234567890,5))

    FinalNumPos = position of the last digit in the second series of numbers
    =MAX(IF(ISERROR(SEARCH({0,1,2,3,4,5,6,7,8,9},Sheet1!$W$4)),"",SEARCH({0,1,2,3,4,5,6,7,8,9},Sheet1!$W$4)))

    Then in Green
    =VLOOKUP(LEFT(W4,FrstNumPos)+0,Sheet2!$A$8:$B$10,2,FALSE)

    In Red
    =MID(W4,MinNumPos,FinalNumPos-MinNumPos+1)/1000
    Attached Files Attached Files

+ 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: 5
    Last Post: 03-07-2013, 07:29 AM
  2. Select an item from drop down list and auto fill in next working date
    By pjlau in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2012, 12:49 AM
  3. [SOLVED] Cell auto fill based on another field drop down list selection
    By pugulis in forum Excel General
    Replies: 3
    Last Post: 03-22-2012, 07:38 AM
  4. Auto fill values based on drop down list
    By Jahoobie in forum Excel General
    Replies: 2
    Last Post: 09-21-2010, 11:04 AM
  5. Auto fill-in based on drop-down list
    By bigchalk in forum Excel General
    Replies: 2
    Last Post: 02-23-2010, 05:18 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