+ Reply to Thread
Results 1 to 6 of 6

if statement

  1. #1
    Registered User
    Join Date
    03-08-2006
    Posts
    35

    if statement

    Hello

    I was wondering if it's possible to do an if-statement were you have more than one condition in the criteria ie something like


    =if(a1<>0,a<1,"yes","no")
    So if a1 is less than 0 and less than 1 print yes otherwise no

    Is that syntax correct?

    Many thanks

  2. #2
    RagDyeR
    Guest

    Re: if statement

    You can use the AND function.

    =If (And(A1<>0,A1<1),"Yes","No")

    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Max_power" <[email protected]> wrote
    in message news:[email protected]...

    Hello

    I was wondering if it's possible to do an if-statement were you have
    more than one condition in the criteria ie something like


    =if(a1<>0,a<1,"yes","no")
    So if a1 is less than 0 and less than 1 print yes otherwise no

    Is that syntax correct?

    Many thanks


    --
    Max_power
    ------------------------------------------------------------------------
    Max_power's Profile:
    http://www.excelforum.com/member.php...o&userid=32255
    View this thread: http://www.excelforum.com/showthread...hreadid=558834



  3. #3
    Registered User
    Join Date
    03-08-2006
    Posts
    35
    Many thanks

  4. #4
    Registered User
    Join Date
    03-08-2006
    Posts
    35
    I apologise for being a bit of a nuisance but is it possible to have multiple conditions in the criteria ie

    =IF(AND(A1<>"TOM",A1<>0,A>0),1,0)

    So I'm trying to say that if cell a1 is not equal to Tom,0 and is greater than 0 then 1 applies otherwise 0

    Many thanks once again

    Max

  5. #5
    Thansal
    Guest

    Re: if statement

    Yes, the AND() Function can take up to 30 different conditions (if I
    remember correctly), It will return TRUE only if all of the conditions
    evaluate to TRUE, otherwise it returns FALSE.

    Max_power wrote:
    > I apologise for being a bit of a nuisance but is it possible to have
    > multiple conditions in the criteria ie
    >
    > =IF(AND(A1<>\"TOM\",A1<>0,A>0),1,0)
    >
    > So I'm trying to say that if cell a1 is not equal to Tom,0 and is
    > greater than 0 then 1 applies otherwise 0
    >
    > Many thanks once again
    >
    > Max
    >
    >
    > --
    > Max_power
    > ------------------------------------------------------------------------
    > Max_power's Profile: http://www.excelforum.com/member.php...o&userid=32255
    > View this thread: http://www.excelforum.com/showthread...hreadid=558834



  6. #6
    Sloth
    Guest

    RE: if statement

    The following funtion does the same thing as using the AND function, but it
    has no limit. I doubt you will ever need more than 30, but the capability is
    there.

    =if((a1<>0)*(a<1),"yes","no")


    The following function does the same thing as using the OR function. Excel
    considers any non zero number as TRUE, and 0 as FALSE.

    =if((a1<>0)+(a<1),"yes","no")


    "Max_power" wrote:

    >
    > Hello
    >
    > I was wondering if it's possible to do an if-statement were you have
    > more than one condition in the criteria ie something like
    >
    >
    > =if(a1<>0,a<1,"yes","no")
    > So if a1 is less than 0 and less than 1 print yes otherwise no
    >
    > Is that syntax correct?
    >
    > Many thanks
    >
    >
    > --
    > Max_power
    > ------------------------------------------------------------------------
    > Max_power's Profile: http://www.excelforum.com/member.php...o&userid=32255
    > View this thread: http://www.excelforum.com/showthread...hreadid=558834
    >
    >


+ 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