=IF(AND Question

Mike Slattery

Board Regular
Joined
Dec 11, 2004
Messages
101
Hi:

Excel 2011 for Mac not happy with the following formula ;√(

=IF(AND(CC3>=-.85*CD3-CE3,CF3>=CD3-.85*CD3-CE3,1,0))

This is a simple test looking to count long tails at the close of the day for a stock.

CC3 = OPEN
CD3 = HIGH
CE3 = LOW
CF3 = CLOSE

Any suggestions?

Thanks, Michael
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi,

You haven't provided much detail, but perhaps try something like:

Code:
=IF(
    AND(
      CC3 >= -0.85 * CD3 - CE3,
      CF3 >= CD3 - 0.85 * CD3 - CE3),
    1,
    0)

or

Code:
=--AND(
       CC3 >= -0.85 * CD3 - CE3,
       CF3 >= CD3 - 0.85 * CD3 - CE3)
 
Upvote 0
Hi Circledchicken: Thanks for your help. I entered "=AND(CC3>=-0.85*CD3-CE3,CF3>= CD3-0.85*CD3-CE3,1,0)" into the cell. No error message was generated by excel this time but the value in the cell is "FALSE" not a 1 or a 0. When you add the "IF" you get a Parentheses needed error message.

Don't know what other information you might like but just let me know, glad to share.

Michael
 
Upvote 0
=IF(AND(CC3>=-.85*CD3-CE3,CF3>=CD3-.85*CD3-CE3,1,0))

CC3 = OPEN
CD3 = HIGH
CE3 = LOW
CF3 = CLOSE

Your parentheses are in the wrong place if I understand your goal. Close the AND function after your two conditions. Now, if both conditions are true, it will return 1 and if one of the conditions is false, it will return 0.

=IF(AND(CC3>=-.85*CD3-CE3,CF3>=CD3-.85*CD3-CE3),1,0)
 
Upvote 0
Hi Circledchicken: Thanks for your help. I entered "=AND(CC3>=-0.85*CD3-CE3,CF3>= CD3-0.85*CD3-CE3,1,0)" into the cell. No error message was generated by excel this time but the value in the cell is "FALSE" not a 1 or a 0.
Why did you enter that into the cell?? That's not what I posted in either option in post #2.
Also you need to ensure you copy the double negative at the front of the formula that converts TRUE and FALSE to 1 and 0 respectively.

Don't know what other information you might like but just let me know, glad to share.
Michael
Perhaps describe in words exactly how you intend your formula to work, and include sample data with the associated expected results.
 
Upvote 0

Forum statistics

Threads
1,217,364
Messages
6,136,114
Members
449,993
Latest member
Sphere2215

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top