+ Reply to Thread
Results 1 to 8 of 8

How to show price in a separate cell when an item is selected in a drop-down box?

  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    Australia
    MS-Off Ver
    Excel for Mac 2008
    Posts
    4

    How to show price in a separate cell when an item is selected in a drop-down box?

    Hi guys! I'm stumped on this one...

    I have a list of products in one column and a list of prices in a separate column next to each.

    On the front worksheet I've got a drop-down box that gives you the option to choose any of the products; what I'd like is for the cell immediately to the right of that to show the corresponding item price based on what's selected.

    Is this possible? I've been Googling this for an hour and have searched these forums to no avail
    Last edited by Jim-G; 06-08-2011 at 12:55 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to show price in a separate cell when an item is selected in a drop-down box?

    Hello and welcome to the Forum,

    What you probably need is a VLOOKUP formula. I don't have a mac but this should work in macs as it does in Win.

    abousetta
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-18-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2003, 2007, 2013 Prof Plus
    Posts
    42

    Thumbs up Re: How to show price in a separate cell when an item is selected in a drop-down box?

    Hi JIM,

    Its absolutely possible what you need.

    Need to Use VLOOKUP formula to get what you want....

    Chk the attached Excel for your reference.

    Regards,
    PBL
    Attached Files Attached Files
    Last edited by pblnrao; 06-06-2011 at 02:53 AM. Reason: Forgot Attachment

  4. #4
    Registered User
    Join Date
    06-06-2011
    Location
    Australia
    MS-Off Ver
    Excel for Mac 2008
    Posts
    4

    Re: How to show price in a separate cell when an item is selected in a drop-down box?

    Guys...

    FANTASTIC!

    You've made my day Thanks very much! I wasn't expecting an answer this quickly, nor one that just works "out of the box", so to speak.

    One further question - I've tried fiddling with it and have only succeeded in breaking it so far:

    Is there a parameter in the VLOOKUP formula (e.g.=IFERROR(VLOOKUP(C6,'Home Prices'!B87:C106,2,0),"")) which would allow me to pull the data from two cells adjoining the cells that are in the drop-down box?

    (e.g. item, cost, notes)

  5. #5
    Registered User
    Join Date
    06-06-2011
    Location
    Australia
    MS-Off Ver
    Excel for Mac 2008
    Posts
    4

    Re: How to show price in a separate cell when an item is selected in a drop-down box?

    ...actually, an extra question if I may:

    I've just discovered named ranges - I've tried to replace the table_array section with a named range thusly:

    =IFERROR(VLOOKUP(C11,'Home Prices'!B150:C169,2,0),"")

    becomes

    =IFERROR(VLOOKUP(C11,"namedRange",2,0),"")

    ...but it doesn't work. What am I doing wrong here?

  6. #6
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: How to show price in a separate cell when an item is selected in a drop-down box?

    Hi Jim

    Remove the quotes around "NamedRange"

    =IFERROR(VLOOKUP(C11,namedRange,2,0),"")

    If you want data from further values in the table, just increase the offset from 2 to 3 or 4 or wherever the data is in the range relative to the looked up value.

    You could use a single formula which changes the offset parameter automatically, if you make use of the COLUMN() function

    =COLUMN(B11) will return 2.
    As you copy the formula to the right , B11 will cahnge to C11 and return 3 etc (the row number is irrelevant).
    So
    =IFERROR(VLOOKUP(C11,namedRange,column(B11),0),"")

    as you copy across, will pull successive values from your range.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  7. #7
    Registered User
    Join Date
    06-06-2011
    Location
    Australia
    MS-Off Ver
    Excel for Mac 2008
    Posts
    4

    Re: How to show price in a separate cell when an item is selected in a drop-down box?

    Quote Originally Posted by Roger Govier View Post
    Hi Jim

    Remove the quotes around "NamedRange"

    =IFERROR(VLOOKUP(C11,namedRange,2,0),"")

    If you want data from further values in the table, just increase the offset from 2 to 3 or 4 or wherever the data is in the range relative to the looked up value.

    You could use a single formula which changes the offset parameter automatically, if you make use of the COLUMN() function

    =COLUMN(B11) will return 2.
    As you copy the formula to the right , B11 will cahnge to C11 and return 3 etc (the row number is irrelevant).
    So
    =IFERROR(VLOOKUP(C11,namedRange,column(B11),0),"")

    as you copy across, will pull successive values from your range.
    Works like a charm - thankyou very much for taking the time to help, it's greatly appreciated

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to show price in a separate cell when an item is selected in a drop-down box?

    Hi,

    Glad we could be of assistance. If you are satisfied with the results, please mark the thread as [SOLVED] (next to the title on the first post). Also positive recognition (scales) are always welcomed .

    If want to mark the post as solved then:

    1) Click the Edit button on your first post in the thread
    2) Click Go Advanced
    3) select [SOLVED] from the Prefix dropdown
    4) click Save Changes

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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