# "IF" statement not giving expected results

1. ## "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.)

2. ## 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)

3. ## Re: "IF" statement not giving expected results

or maybe this:

=1+MOD(B3,5)

4. ## 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. ## 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. ## Re: "IF" statement not giving expected results

You're wellcome

7. ## 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.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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