+ Reply to Thread
Results 1 to 10 of 10

Entering a formula in a cell based on the selections in two other drop down lists

  1. #1
    Registered User
    Join Date
    12-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Entering a formula in a cell based on the selections in two other drop down lists

    Hi I have 2 columns with drop down boxes. Column A has many options that I can select in a drop down list. Examples are I buy foreign currency, I sell foreign currency, I buy C$, I sell C$, I buy GBP, I sell GBP. Column B has a list of currencies (C$, US$, GBP for example). Column C is where I input a number (say 100,000), and Column D is where I input a conversion rate (say 1.50). I then have 4 columns (E to H), one for each of 4 currencies, one of which will populate using a formula based on the selections in A and B. So for example, if Column A selected I buy C$ and Column B selected US$, then Column E (which has my US$ values) would show the result of a formula multiplying 100,000 times 1.50. But I then want the other 3 columns to remain empty since the selections in A and B exclude them. Is there a simple way to do something like this? Thanks for any help!

  2. #2
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    Please upload a sample spreadsheet (scrubbed for any sensitive data).
    To upload, click "go advanced" and "manage attachments".
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  3. #3
    Registered User
    Join Date
    12-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    Did it work? I just tried to do it
    Attached Files Attached Files

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    In F2
    =IF($C2="USD",$D2*$E2,"")

    In G2
    =IF($C2="GBP",$D2*$E2,"")

    In H2
    =IF($C2="EUR",$D2*$E2,"")

    In I2
    =IF($C2="CAD",$D2*$E2,"")

    Copied down. Does that help?
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    12-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    thanks, that doesnt really work since it ignores the selection in column B>

    For example if B2 selects "Desk Buys Foreign vs CAD" and C2 selects "USD" then F2 would return "=D2", G2 and H2 would be blank, and I2 would return "=D2*E2"

    But if C2 selected "GBP" instead then F2 and H2 would be blank, G2 would return "=D2", and I2 would return "=D2*E2"

    Does that make sense? I am trying to avoid doing a very long nested ifstatement (my actual sheet has many more options in each drop down list)

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    I changed the row headings in Row 1 from Column F onwards to reflect the 3 letter currency. Please see attched

  7. #7
    Registered User
    Join Date
    12-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    Thanks! I'm trying to figure out what you did - I am not familiar with these formulas! I will let you know when I get a better understanding of the because I will have to expand it and make some changes (right now the formula isn't differentiating between positive and negative values, and also isnt differentiating between when the formula requires a multiplication or division. But I am really hoping that this will help incorporate these requirements, Thanks a lot!

    Just as an example

    -->if B2 is Desk Buys Foreign vs CAD and C2 is USD, F2 formula should be "=D2" and I2 formula should be "=-(D2)*E2"

    -->if B2 is Desk Sells Foreign vs CAD and C2 is USD, F2 formula should be "=-(D2)" and I2 formula should be "=D2*E2"

    --> if B2 is Desk Buys Foreign vs USD and C2 is CAD, F2 formula should be "=-(D2)/E2" and I2 formula should be "=D2"

    --> if B2 is Desk Sells Foreign vs USD and C2 is CAD, F2 formula should be "=D2/E2" and I2 formula should be "=-(D2)"


    Does that make sense?

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    See edited attachment. Havent proof read all results, hopefully it works

    The logic is to search for the 3 letter currency (USD,CAD,GBP etc) and "buys" or "sells" and accordingly determine the rate and the +/- sign
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    Thanks - got part of it right (the positive or negative amount), but not the direction (whether to multiply or divide by - thats the part that i can never get past)

    Thanks for trying!

  10. #10
    Registered User
    Join Date
    12-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Entering a formula in a cell based on the selections in two other drop down lists

    I think I solved it myself thanks!

+ 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