+ Reply to Thread
Results 1 to 9 of 9

IF with more than 2 output options

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    Cincinnati
    MS-Off Ver
    Microsoft Office 2010
    Posts
    6

    IF with more than 2 output options

    I am trying to create 3 options instead of just true or false options of an if statement. This is what I need:

    If B3 is greater than A3 and less than C3, the D3 will have the value of Number B3 in it
    If B3 is less than A3, then D3 will have the value of number A3 in it
    If B3 is greater than C3, then D3 will have the value of number C3 in it

    I am so close but I just don't know what I did wrong.

    Here is what I have:

    =IF(AND(B3>A3,A3<C3),B3,IF(AND(B3<A3,A3>C3),C3,A3))

    Thanks for the help.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: IF with more than 2 output options

    Welcome to the board.

    In D3, =MAX(A3, MIN(B3:C3))

    Or =MEDIAN(A3:C3)
    Last edited by shg; 05-26-2011 at 03:39 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-26-2011
    Location
    Cincinnati
    MS-Off Ver
    Microsoft Office 2010
    Posts
    6

    Re: IF with more than 2 output options

    Thanks. Now I'm trying to assign letter grades to an average. I followed a tutorial I found but it must not be for 2010 version. Do you know of a tutorial for the 2010 version?

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: IF with more than 2 output options

    What are the letters and averages?

    There's a tutorial here
    http://www.learnexcel.org/blog/learn...ntextures-com/
    Last edited by Cutter; 05-26-2011 at 07:10 PM.

  5. #5
    Registered User
    Join Date
    05-26-2011
    Location
    Cincinnati
    MS-Off Ver
    Microsoft Office 2010
    Posts
    6

    Re: IF with more than 2 output options

    You guys are awesome. Now I'm doing some more logic stuff with AND, OR, NAND, and NOR gates. I can't really explain what I am doing too well but I will try. I'm trying to change the output (E3) to reflect which ever gate is typed into F3 depending on the two inputs (C3 and D3). I hope you can figure out what I am trying to do. Here is the equation I have but excel doesn't like it and I can't figure out what is wrong with it. Thank you so much for your help.

    =IF(F3="AND",IF(AND(C3=0,D3=0),0,IF(AND(C3=0,D3=1),0,IF(AND(C3=1,D3=0),0,IF(AND(C3=1,D3=1),1,"N/A")))),F(F3="OR",IF(AND(C3=0,D3=0),0,IF(AND(C3=0,D3=1),1,IF(AND(C3=1,D3=0),1,IF(AND(C3=1,D3=1),1,"N/A")))),IF(F3="NAND",IF(AND(C3=0,D3=0),1,IF(AND(C3=0,D3=1),1,IF(AND(C3=1,D3=0),1,IF(AND(C3=1,D3=1),0,"N/A"))),IF(F3="NOR",IF(AND(C3=0,D3=0),1,IF(AND(C3=0,D3=1),1,IF(AND(C3=1,D3=0),1,IF(AND(C3=1,D3=1),0,"N/A")))),"N/A")

  6. #6
    Registered User
    Join Date
    05-26-2011
    Location
    Cincinnati
    MS-Off Ver
    Microsoft Office 2010
    Posts
    6

    Re: IF with more than 2 output options

    Anyone? Please. I really need to get this done.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: IF with more than 2 output options

    Please Login or Register  to view this content.
    D2 and down,

    =--CHOOSE(MATCH(C2, {"and","nand","or","nor","xor"}, 0), AND(A2:B2), NOT(AND(A2:B2)), OR(A2:B2), NOT(OR(A2:B2)), A2<>B2)

  8. #8
    Registered User
    Join Date
    05-26-2011
    Location
    Cincinnati
    MS-Off Ver
    Microsoft Office 2010
    Posts
    6

    Re: IF with more than 2 output options

    That looks like multiple lines. Is that code box the excel worksheet? The teacher said you are not allowed to use multiple lines. I don't know what that means. This is an assignment for school and I can not figure this out. I don't think you can set up the excell worksheet like that I think it has to be all one line.

  9. #9
    Registered User
    Join Date
    05-26-2011
    Location
    Cincinnati
    MS-Off Ver
    Microsoft Office 2010
    Posts
    6

    Re: IF with more than 2 output options

    Please someone?

+ 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