+ Reply to Thread
Results 1 to 10 of 10

Two-condition If formula

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-09-2008
    Location
    Dallas
    MS-Off Ver
    2007
    Posts
    121
    Quote Originally Posted by NBVC
    Try:

    =IF(AND(B3="Max",C3="Sell"), D3-J17,0)
    How does that work if he's using drop-boxes? Values in B3 and C3 won't actually be "Max" and "Sell", respectively; they'll be a numeric value... Won't they? Maybe I missed something.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by jwhitwell
    How does that work if he's using drop-boxes? Values in B3 and C3 won't actually be "Max" and "Sell", respectively; they'll be a numeric value... Won't they? Maybe I missed something.

    I assumed (and looks like I was right based on the OP's response) that he meant he had Data Validation drop down... not Forms/Controls drop downs...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    07-09-2008
    Location
    Dallas
    MS-Off Ver
    2007
    Posts
    121
    Quote Originally Posted by NBVC
    I assumed (and looks like I was right based on the OP's response) that he meant Data Validation drop down... not Forms/Controls drop downs...
    Ooh, good point - well done.

  4. #4
    Registered User
    Join Date
    08-08-2008
    Location
    UK
    Posts
    24
    yes sorry its data validation drop down, but now i have another problem

    =IF(AND(B3="EURCHF",C3="Sell"),D3-J17,IF(AND(B3="EURCHF",C3="Buy"),D3+J17,(IF(AND(B3="EURGBP",C3="Sell"),D3-J13,IF(AND(B3="EURGBP",C3="Buy"),D3+J13,IF(AND(B3="EURJPY",C3="Sell"),D3-J19,IF(AND(B3="EURJPY",C3="Buy"),D3+J19, IF(AND(B3="USDCHF",C3="Sell"),D3-J15,IF(AND(B3="USDCHF",C3="Buy"),D3+J17,0)))))))))
    
    Its complaining that the last AND(...) formula has something wrong with it, but as far as i can see its fine! Any ideas?
    Last edited by NBVC; 08-08-2008 at 01:14 PM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You have to many nested functions... Excel 2003 and earlier only allow up to 7 nested functions...

    You can try creating 7 separate IFs and add the results... they should all return 0 except for the one that has the right combo...so when added together you should get the correct result...

    Try:

    =IF(AND(B3="EURCHF",C3="Sell"),D3-J17,0)+IF(AND(B3="EURCHF",C3="Buy"),D3+J17,0)+IF(AND(B3="EURGBP",C3="Sell"),D3-J13,0)+IF(AND(B3="EURGBP",C3="Buy"),D3+J13,0)+IF(AND(B3="EURJPY",C3="Sell"),D3-J19,0)+IF(AND(B3="EURJPY",C3="Buy"),D3+J19,0)+IF(AND(B3="USDCHF",C3="Sell"),D3-J15,0)+IF(AND(B3="USDCHF",C3="Buy"),D3+J17,0)

  6. #6
    Registered User
    Join Date
    08-08-2008
    Location
    UK
    Posts
    24
    hehe thats works, you are an excel god !

+ 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