+ Reply to Thread
Results 1 to 7 of 7

Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

  1. #1
    Registered User
    Join Date
    02-08-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    3

    Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    Hi everyone,

    I have 4 price lists - they all have the same products and codes but are in different currencies. I would like to consolidate these into one and then display the correct price based on Data Validation drop down containing GBP, USD, Euro and RAND. Cell G2 (also named as Currency_Selected)

    I have a table [Prices] in one sheet with product code, name and then 4 columns with price in each currency. On the second sheet I have already worked out to create a data validation drop list using the Product_Code - then using VLOOKUP I have populated the name and price in GBP (column 5) =VLOOKUP($A16,Prices,5,FALSE). I am assuming I need to somehow use and IF command to also bring in the Currency_Selected in order to to select the another column eg column 5 for USD.

    I have tried some nested IF statements but just cant seem to get it working. Any advice appreciated - even a different approach.

    Thanks.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    GBP, USD, Euro and RAND

    = IF ( G2= "GBP", VLOOKUP($A16,Prices,5,FALSE), if( G2="USD", VLOOKUP($A16,Prices,???,FALSE), if( G2="Euro", VLOOKUP($A16,Prices,???,FALSE), VLOOKUP($A16,Prices,???,FALSE) )))

    where ??? is the column number for the different currencies

    thats one way - there are others - see how that works first

    i'm also assuming as you only have 4

    GBP, USD, Euro and RAND

    that if when
    RAND is selected
    and we have an IF for the other three
    GBP, USD, Euro

    then i have just defaulted to
    RAND

    hence no IF testing for RAND
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    Hi,

    Presumably you will have two drop down cells, one for Product Code and another for Currency.
    Assuming your Prices table starts in A1 with column labels in row 1 then use a helper cell to identify which column of the table contains the drop down you've selected. So assuming B16 is the currency drop down in say C16 enter

    =MATCH(B16,TableSheet!1:5,False)
    Name this C16 cell say "Currency"

    Then your vlookup is

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    02-08-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    Price List.xlsx
    Great - thanks this seems to have worked. I had been try to do the other way around with the VLOOKUP 1st then if statements inside.
    Couple of additional questions;
    1 - Is there a way to reference the table column in the VLOOKUP rather than a column number? eg in VLOOKUP($A16,Prices,5,FALSE) can I use Prices[USD - License] instead of column 5?
    2 - Can I set the number formatting based on the currency selected eg i have used the following - if Currency_Selected="USD$" then use accounting format $ United States which is _-[$$-409]* #,##0.00_ ;_-[$$-409]* -#,##0.00 ;_-[$$-409]* "-"??_ ;_-@_ [when I look in custom format]

    =IF(Currency_Selected="USD$",VLOOKUP($A5,Prices,6,FALSE),IF(Currency_Selected="GBP£",VLOOKUP($A5,Prices,9,FALSE),IF(Currency_Selected="EURO",VLOOKUP($A5,Prices,12,FALSE),IF(Currency_Selected="RAND",VLOOKUP($A5,Prices,15,FALSE),0))))
    Last edited by EssexKiwi; 02-09-2014 at 07:20 AM.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    Hi,

    Re 1. Short answer is no. the 3rd element of the lookup needs to be a number which is why I suggested you use the MATCH & INDEX formulae. There was a typo in my original. Applied to your latest workbook it would be
    =MATCH(F2,Prices!1:1,False)
    but of course F2 needs to be in the first row of the Prices tab.

    You seem to have reverted to the more complex set of IF functions

    Re 2. Have you tried conditional formatting?

    I've taken the liberty of slightly modifying your workbook and avoiding the IF functions, and adding the conditional formats. See attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-08-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    Brilliant - thanks this was just what I was looking for and have now added to my master sheet and progressed further.

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Changes VLOOKUP values based on two Drop Down (Data Validation) Selections

    Excellent. Glad I could help and thanks for the rep.

+ 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] Populate data based on several drop down selections
    By NerdALRT in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2014, 03:42 PM
  2. [SOLVED] Update respective cell values in the table based on Multiple Drop Down list selections.
    By nileshpatil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2012, 09:30 AM
  3. Filter data in one tab based on drop down selections in a different tab
    By ragonef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2012, 09:27 AM
  4. VLOOKUP with drop down selections
    By tony666 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 12-02-2010, 08:48 AM
  5. VLOOKUP with Drop down results with multiple selections
    By tony666 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-22-2010, 07:13 AM

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