# IF THEN AND Statement Help

Solved/Closed
ralphl
Posts
16
Registration date
Monday December 8, 2008
Status
Member
Last seen
December 12, 2008
- Dec 9, 2008 at 01:21 PM
ralphl - Dec 15, 2008 at 08:44 AM
Hello Everyone,

I am trying to make a formula work and I'm having a headache from it.

Here it is:

=IF(AND(\$B\$2<"5.9", \$B\$9="1.012"),\$B\$2-"0.1")

Very basic, or so I thought, but it does not give the right answer.

What I am trying to do is on Cell \$F\$19 I want to check IF B2 is 5.9 or less AND B9 is 1.012 THEN B2 minus 0.1

Any suggestion is greatly appreciated.

Thanks

Ralph Lemus

## 27 replies

ralphl
Posts
16
Registration date
Monday December 8, 2008
Status
Member
Last seen
December 12, 2008

Dec 10, 2008 at 05:32 PM
Actually I had the = sign in there before and it did not work, BUT I copied and pasted it and it worked.

Thank you so much aquarelle. You have saved me from a heart attack!

Thanks again!
aquarelle
Posts
7115
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 2, 2022
491
Dec 10, 2008 at 05:38 PM
Wonderful !!! Very happy and it was a pleasure to help you. Maybe see you in the future somewhere on kioskea !
Bye
ralphl
Posts
16
Registration date
Monday December 8, 2008
Status
Member
Last seen
December 12, 2008

Dec 10, 2008 at 05:46 PM
One last question, if possible. In the formula that I had, can I place a range of numbers that need to exist in order for the actual formula to work?

Let me elaborate:

For example in the Spreadsheet that I sent you on the right hand side there was a range of numbers that on either side of the middle column. What I need when B9=1.008 I need to subtract 0.3 from Cell B2, or if B9=1.010, subtract 0.2 from cell B2, and so on. Can that happen?
aquarelle
Posts
7115
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 2, 2022
491
Dec 10, 2008 at 05:52 PM
Yes, it is possible. I'm going to sleep now because in France where I am, it is 00:48 AM, but tomorrow, if you want, we could look at it.
ralphl
Posts
16
Registration date
Monday December 8, 2008
Status
Member
Last seen
December 12, 2008

Dec 10, 2008 at 05:57 PM
Au revoir, and Merci beaucoup
ralphl
Posts
16
Registration date
Monday December 8, 2008
Status
Member
Last seen
December 12, 2008

Dec 11, 2008 at 03:37 PM
Let me know when you have a chance. I really do appreciate your help and your time.

Didn't find the answer you are looking for?

aquarelle
Posts
7115
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 2, 2022
491
Dec 12, 2008 at 06:20 AM
Hello,
Sorry, but finally, I couldn't do it yesterday. Try this formula and tell me back if it is all right :
`=IF(OR(B9=1.012,B9=1.013,B9=1.014,AND(B2<=5.9)),B2-0.1,IF(OR(B9=1.011,B9=1.01,B9=1.009,AND(B2<=5.9)),B2-0.2,IF(OR(B9=1.008,B9=1.007,B9=1.006,AND(B2<=5.9)),B2-0.3,IF(OR(B9=1.005,B9=1.004,B9=1.003,AND(B2<=5.9)),B2-0.4,IF(OR(B9=1.002,B9=1.001,B9=1,AND(B2<=5.9)),B2-0.5,0)))))`

See you
ralphl
Posts
16
Registration date
Monday December 8, 2008
Status
Member
Last seen
December 12, 2008

Dec 12, 2008 at 09:05 AM
Listen, there is no reason for you to say sorry. I really appreciate all that you have done. You have been a saint. I should be the one saying sorry for the inconvenience.

OK, back to the formula, it seems right but it does not adjust the numbers correctly. no matter what I put in B9 cell it gives me the answer of 5.8. I have been looking through the formula, and theoretically it should have worked, but it didn't.

Once again thanks for your efforts and time
aquarelle
Posts
7115
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
June 2, 2022
491
Dec 12, 2008 at 11:46 AM
Hello,
No, I'm not a saint O:-), but someone who like to help as possible and I don't like to say something and not to do it ;)
So don't think you bother me ! Ok ?
Effectively, the formula doesn't work, try this new one :
`=IF(AND(AND(OR(B9=1.012,B9=1.013,B9=1.014),B2<=5.9)),B2-0.1,IF(AND(AND(OR(B9=1.011,B9=1.01,B9=1.009),B2<=5.9)),B2-0.2,IF(AND(AND(OR(B9=1.008,B9=1.007,B9=1.006),B2<=5.9)),B2-0.3,IF(AND(AND(OR(B9=1.005,B9=1.004,B9=1.003),B2<=5.9)),B2-0.4,IF(AND(AND(OR(B9=1.002,B9=1.001,B9=1),B2<=5.9)),B2-0.5,0)))))`

See you
Once again, you are a saint. It worked. Once I'm done I will show you the fruits of "Our" Labor.

Thanks

Ralph L