# If and AND function together

#### shonu1320

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

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

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

Oh My Gosh! It worked perfectly Thank you so much for quick reply. I see where I was missing the conditions.

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","")

Is it?

=IF(A5="NO",IF(AND(A7>0,A8>0),"CHECK",""),"")
Or more simply:

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

T.Valko, it is giving me error at the ""

Or more simply:

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

I thought so but this statement from the OP confused me:

=IF(AND(A5="NO",(A7>0,A8>0)),"CHECK","")
This formula said CHECK even when A5 is not equal to NO

T.Valko, it is giving me error at the ""
What is in A7 and A8?

Note what I posted in my other reply about TEXT being in those cell.

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

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.

Replies
2
Views
183
Replies
7
Views
196
Replies
3
Views
190
Replies
1
Views
184
Replies
3
Views
208

Threads
1,206,826
Messages
6,075,094
Members
446,119
Latest member
BrianAndrews

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

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