+ Reply to Thread
Results 1 to 8 of 8

If (condition1) AND (either condition 2 3 or 4)

  1. #1
    Registered User
    Join Date
    02-09-2010
    Location
    Cardiff, Wales!
    MS-Off Ver
    Excel 2007/2010
    Posts
    10

    If (condition1) AND (either condition 2 3 or 4)

    Hi, looking for some help.

    At the moment I have the following formula
    Please Login or Register  to view this content.
    This is ok, if I5 and J5 are both bigger than 0 then display '1'. However I now need to add to that statement 'AND (IF EITHER L15, L16 or L17 > 0)'.

    Its quite hard to explain in text, not sure if this makes any sense so see attached XLS.

    I dont think it should be difficult, just getting the syntax right and I dont use excel much any more
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: If (condition1) AND (either condition 2 3 or 4)

    Does this help ?

    =IF((AND(I5>0,J5>0,or(l15>0,l16>0,l17>0)),1,"")

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If (condition1) AND (either condition 2 3 or 4)

    Or, another variant:

    =IF(AND(MIN(I5:J5)>0,MAX(L15:L17)>0),1,"")
    Last edited by DonkeyOte; 07-14-2010 at 05:50 AM. Reason: Col L rather than Col I (see post #5 edit)

  4. #4
    Registered User
    Join Date
    02-09-2010
    Location
    Cardiff, Wales!
    MS-Off Ver
    Excel 2007/2010
    Posts
    10

    Re: If (condition1) AND (either condition 2 3 or 4)

    Judging by the cells that it selected I think its exactly what I need, however excel is telling me theres something wrong with the formula? :S

    EDIT: Both of those say that there is somethign wrong with the formula (does say what though!).. both are selecting the right cells though. Must be something to do with the brackets or "'s or something?
    Last edited by jbird123; 07-14-2010 at 05:43 AM.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If (condition1) AND (either condition 2 3 or 4)

    There's nothing wrong with edit: my formula based on your locale (UK)

    If you're using non-UK settings such that your delimiter is something other than comma then you will need to modify accordingly... eg for Contintenal Europe:

    =IF(AND(MIN(I5:J5)>0;MAX(L15:L17)>0);1;"")

    EDIT: though it might help if I actually referenced the correct cells !
    Last edited by DonkeyOte; 07-14-2010 at 05:50 AM.

  6. #6
    Registered User
    Join Date
    02-09-2010
    Location
    Cardiff, Wales!
    MS-Off Ver
    Excel 2007/2010
    Posts
    10

    Re: If (condition1) AND (either condition 2 3 or 4)

    Quote Originally Posted by DonkeyOte View Post
    EDIT: though it might help if I actually referenced the correct cells !
    Lol yeah I did change that, tis ok.

    Thats strange then, maybe its something to do with excel saying at the top 'compatability mode'? Thats the only thing I could think of!

    Sorry the screenshot is a gif (and why does it think its a jpg :S ) but it was too big to upload as a jpg or png
    Attached Images Attached Images

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If (condition1) AND (either condition 2 3 or 4)

    There is a superfluous parenthesis in the embedded IF approach, should read:

    =IF(AND(I5>0,J5>0,OR(L15>0,L16>0,L17>0)),1,"")

    The other formula (MIN/MAX) should not require any alteration.

  8. #8
    Registered User
    Join Date
    02-09-2010
    Location
    Cardiff, Wales!
    MS-Off Ver
    Excel 2007/2010
    Posts
    10

    Re: If (condition1) AND (either condition 2 3 or 4)

    Quote Originally Posted by DonkeyOte View Post
    There is a superfluous parenthesis in the embedded IF approach, should read:

    =IF(AND(I5>0,J5>0,OR(L15>0,L16>0,L17>0)),1,"")

    The other formula (MIN/MAX) should not require any alteration.
    Woo yeah that works! Thank youu

+ 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