+ Reply to Thread
Results 1 to 7 of 7

"IF" statement not giving expected results

  1. #1
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Berkley, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    299

    "IF" statement not giving expected results

    The numbers in B3=0, C3=2 and D3=0 the formula I'm using is:

    =IF(B3="0",1,IF(B3="5",1,IF(B3="1",2,IF(B3="6",2,IF(B3="2",3,IF(B3="7",3,IF(B3="3",4,IF(B3="8",4,IF(B3="4",5,IF(B3="9",5))))))))))

    For cell "B3" the formula works

    Now for both the next two cells C3 & D3 the formula is:

    =IF(C3="0",1,IF(C3="5",1,IF(C3="1",2,IF(C3="6",2,IF(C3="2",3,IF(C3="7",3,IF(C3="3",4,IF(C3="8",4,IF(C3="4",5,IF(C3="9",5))))))))))

    =IF(D3="0",1,IF(D3="5",1,IF(D3="1",2,IF(D3="6",2,IF(D3="2",3,IF(D3="7",3,IF(D3="3",4,IF(D3="8",4,IF(D3="4",5,IF(D3="9",5))))))))))

    Doesn't work and displays "FALSE" ?????

    I don't the luxury of wasting time, the formula should work but I don't understand why it isn't, could anyone please help me. (Probably just stressed and tried.)

    Thanks ahead of time,

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,905

    Re: Another "IF" statement problem

    If you are looking for numbers in D3, you shouldn't have quotes around them....

    or perhaps this could work:

    =CHOOSE(B3+1,1,2,3,4,5,1,2,3,4,5)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,430

    Re: "IF" statement not giving expected results

    or maybe this:

    =1+MOD(B3,5)

  4. #4
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Berkley, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    299

    Re: Another "IF" statement problem

    Try it and its not working, yes numbers do appear but not the right numbers. Sorry.

    The legend is the numbers: 0 and 5 = 1, 1 and 6 = 2, 2 and 7 = 3, 3 and 8 = 4, 4 and 9 = 5

    So the number example in B,C,D is 020 what I'm wanting the calculation to show is "1, 3, 1" and for some reason I get the right number in cell B but in C and D cells I get a "FALSE" statement. And I don't understand why that is happening.

  5. #5
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Berkley, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    299

    Re: "IF" statement not giving expected results

    The Modula statements seems to work! Thanks I will use it, if something goes wrong I'll jump back on the forum and ask the question again. I forgot all about that function - "so close you can't see the trees because of the forest".

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,430

    Re: "IF" statement not giving expected results

    You're wellcome

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,905

    Re: "IF" statement not giving expected results

    I am not saying that the MOD() doesn't work, but if it does, than so does the CHOOSE() given. They both gave same results for me.

+ 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