If and AND function together

shonu1320

Board Regular
Joined
Mar 10, 2011
Messages
54
I am trying to construct a formula using If and AND function together and needs help with the same.

I want to say IFA5="NO", AND A7>0 and A8>0, then output "Check", Otherwise leave it blank

A5, A7, and A8 also have a If formula nested in them.

It sounds simple and I have done couple of arguments but I am only getting error.

Here are my try's
=IF(A5)="NO",AND(A7>0,A8>0),"CHECK","" I got errors on this formula
OR
=IF(AND(A5="NO",(A7>0,A8>0)),"CHECK","")
This formula said CHECK even when A5 is not equal to NO, said TRUE when both the conditions were true(but I want it to say check instead of true)and said FALSE when IF condition met but AND condition did not meet(I want it to leave the cell blank instead of calling it false.
What am I doing wrong and how can I fix it? Please Help!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

shonu1320

Board Regular
Joined
Mar 10, 2011
Messages
54
Oh My Gosh! It worked perfectly :) Thank you so much for quick reply. I see where I was missing the conditions.
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
I am trying to construct a formula using If and AND function together and needs help with the same.

I want to say IFA5="NO", AND A7>0 and A8>0, then output "Check", Otherwise leave it blank

A5, A7, and A8 also have a If formula nested in them.

It sounds simple and I have done couple of arguments but I am only getting error.

Here are my try's
=IF(A5)="NO",AND(A7>0,A8>0),"CHECK","" I got errors on this formula
OR
=IF(AND(A5="NO",(A7>0,A8>0)),"CHECK","")
This formula said CHECK even when A5 is not equal to NO, said TRUE when both the conditions were true(but I want it to say check instead of true)and said FALSE when IF condition met but AND condition did not meet(I want it to leave the cell blank instead of calling it false.
What am I doing wrong and how can I fix it? Please Help!
Try it like this...

=IF(AND(A5="NO",A7>0,A8>0),"CHECK","")

Note that if A7 and/or A8 contain TEXT (or formula blanks) then the test for >0 will evaluate to TRUE.

Yo may need/want to also test that the cells contain numbers. Something like this will do that:

=IF(AND(A5="NO",COUNTIF(A7:A8,">0")=2),"CHECK","")
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
=IF(A5="NO",IF(AND(A7>0,A8>0),"CHECK",""),"")
=IF(AND(A5="NO",A7>0,A8>0),"CHECK","")

"Mechanically", both formulas do the exact same thing.

They just get there from different directions. ;)
 

shonu1320

Board Regular
Joined
Mar 10, 2011
Messages
54
A7 and A8 have if formula nested in them to bring value in numbers.

I don't know why both the formulas did not work the same for me.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,851
Messages
5,833,967
Members
430,249
Latest member
Muka

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
Top