+ Reply to Thread
Results 1 to 4 of 4

How to express this in an if statement.

  1. #1
    kevin
    Guest

    How to express this in an if statement.

    I hope someone might be able to show me how to express the following in an IF
    statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6
    then "medium", if(a1 is between 7 and 10 then "high", if(a1>10 then
    "extreme", "")
    --
    Thanks Kevin

  2. #2
    JE McGimpsey
    Guest

    Re: How to express this in an if statement.

    One way:

    If one can assume that there will be no numbers < 0, and that all
    numbers are integers:

    =LOOKUP(A1,{0,4,7,11},{"low","medium","high","extreme"})

    (otherwise, you need to specify what happens for negative numbers and
    non-integers, like 6.5)

    As an IF() statement:


    Strictly:

    =IF(AND(A1>=0,A1<=3),"low",IF(AND(A1>=4,A1<=6),"medium",
    IF(AND(A1>=7,A1<=10),"high",IF(A1>10,"extreme","something else"))))

    or, using the above assumptions:

    =IF(A1<=3,"low",IF(A1<=6,"medium",IF(A1<=10,"high","extreme")))



    In article <4FCA8F37-1F47-4F26-9CAA-8994E3BC5CD2@microsoft.com>,
    "kevin" <kevin@discussions.microsoft.com> wrote:

    > I hope someone might be able to show me how to express the following in an IF
    > statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6
    > then "medium", if(a1 is between 7 and 10 then "high", if(a1>10 then
    > "extreme", "")


  3. #3
    Niek Otten
    Guest

    Re: How to express this in an if statement.

    Hi Kevin,

    You don't tell what it has to be if A1<0, what if it is 3.5, etc, but this
    may help:

    =IF(A1<4,"low",IF(A1<7,"medium",IF(A1<11,"high","extreme")))

    --

    Kind Regards,

    Niek Otten

    Microsoft MVP - Excel

    "kevin" <kevin@discussions.microsoft.com> wrote in message
    news:4FCA8F37-1F47-4F26-9CAA-8994E3BC5CD2@microsoft.com...
    >I hope someone might be able to show me how to express the following in an
    >IF
    > statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6
    > then "medium", if(a1 is between 7 and 10 then "high", if(a1>10 then
    > "extreme", "")
    > --
    > Thanks Kevin




  4. #4
    kevin
    Guest

    Re: How to express this in an if statement.

    Thanks very much for your help, works great.

    "Niek Otten" wrote:

    > Hi Kevin,
    >
    > You don't tell what it has to be if A1<0, what if it is 3.5, etc, but this
    > may help:
    >
    > =IF(A1<4,"low",IF(A1<7,"medium",IF(A1<11,"high","extreme")))
    >
    > --
    >
    > Kind Regards,
    >
    > Niek Otten
    >
    > Microsoft MVP - Excel
    >
    > "kevin" <kevin@discussions.microsoft.com> wrote in message
    > news:4FCA8F37-1F47-4F26-9CAA-8994E3BC5CD2@microsoft.com...
    > >I hope someone might be able to show me how to express the following in an
    > >IF
    > > statement. =if(a1 is between 0 and 3 then "low", if(a1 is between 4 and 6
    > > then "medium", if(a1 is between 7 and 10 then "high", if(a1>10 then
    > > "extreme", "")
    > > --
    > > Thanks Kevin

    >
    >
    >


+ 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