+ Reply to Thread
Results 1 to 3 of 3

if and and statements

  1. #1
    Combining multiple if & and statements
    Guest

    if and and statements

    Looking for help with a 2 x 4 matrix with the following conditions

    A1 B1 C1
    Answer
    3 0 1
    A1*4+2
    3 0 2
    0
    3 1 1
    A1*2+1
    3 1 2
    0

    =IF(AND(B1=0,C1=1),+A1*4*2,IF(AND(B1=0,C1=2),0,IF(AND(B1=1,C1=0),+A1*2+1,IF(AND(B1=1,C1=2),0,""))))

    This turns up as FALSE. Makes no sense? maybe brackets around formula?

    PS--- I could simplify by using the "0" for any case where c1 is 2; BUT,
    first I would like to get this to work.

    Any Ideas?

    Thanks

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    I am not sure that I completely understand your question.

    But a couple of comments:
    - I think your 3 1 1 example should read 3 1 0
    - 0 is FALSE any other number is TRUE
    it just depends on how the cell is formatted

    hope this helps

    Quote Originally Posted by Combining multiple if & and statements
    Looking for help with a 2 x 4 matrix with the following conditions

    A1 B1 C1
    Answer
    3 0 1
    A1*4+2
    3 0 2
    0
    3 1 1
    A1*2+1
    3 1 2
    0

    =IF(AND(B1=0,C1=1),+A1*4*2,IF(AND(B1=0,C1=2),0,IF(AND(B1=1,C1=0),+A1*2+1,IF(AND(B1=1,C1=2),0,""))))

    This turns up as FALSE. Makes no sense? maybe brackets around formula?

    PS--- I could simplify by using the "0" for any case where c1 is 2; BUT,
    first I would like to get this to work.

    Any Ideas?

    Thanks

  3. #3
    Don Guillett
    Guest

    Re: if and and statements

    Look in the help index for AND
    =and(condition1,condition2)
    =and(condition1,condition2,condition3)

    AND get rid of your + at the start of a formula
    ),+A1*4*2,IF
    ),A1*4*2,IF
    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Combining multiple if & and statements" <Combining multiple if & and
    statements @discussions.microsoft.com> wrote in message
    news:[email protected]...
    > Looking for help with a 2 x 4 matrix with the following conditions
    >
    > A1 B1 C1
    > Answer
    > 3 0 1
    > A1*4+2
    > 3 0 2
    > 0
    > 3 1 1
    > A1*2+1
    > 3 1 2
    > 0
    >
    > =IF(AND(B1=0,C1=1(AND(B1=0,C1=2),0,IF(AND(B1=1,C1=0),+A1*2+1,IF(AND(B1=1,C1=2),0,""))))
    >
    > This turns up as FALSE. Makes no sense? maybe brackets around formula?
    >
    > PS--- I could simplify by using the "0" for any case where c1 is 2; BUT,
    > first I would like to get this to work.
    >
    > Any Ideas?
    >
    > 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