# Correct IF, AND syntax

#### ddub25

##### Well-known Member
I am struggling to compose the correct syntax for these IF's, AND's in one formula.

IF B11 >0,
AND result from, =SUMIFS(N5:N16,Q5:Q16,"") returns 0
Then return "h"

IF B11 =0
OR B11 =""
Then return "q"

Can anyone help. Thanks.

Dan

### Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the \$ sign).
Are there any chances that B11 will be negative?

No, B11 will always be either empty or positive. Thanks.

Dan

Try the following
=IF(OR(B11=0,B11=""),"q",IF(SUMIFS(N5:N16,Q5:Q16,"")=0,"h","The Else Case"))
Replace "The Else Case" with something you need which will come in picture when B11 is positive and SUMIFS is greater than 0.

Is this what you are looking for?

=IF(B11=0,"q",IF(SUMIFS(N5:N16,Q5:Q16,"")=0,"h",SUMIFS(N5:N16,Q5:Q16,"")))

Try This,

Code:
``=IF(AND(B11>0,SUMIFS(N5:N16,Q5:Q16,"")=0),"h",IF(OR(B11=0,B11=""),"q","Condition Variance"))``

Thanks for both of your help. Solved my problem. Thanks.

Dan

=IF(C13=0,"q",IF(SUMIFS(M5:M17,O5:O17,"")=0,"h",SUMIFS(M5:M17,O5:O17,"")))

Here is the most recent update of the formula. I'd like to add an extra condition to the formula returning 'q'.

At present it returns 'q':
IF C13 =0

I would like the following:
IF C13 =0
AND IF M5:M17 =0
Then return "q"

Any ideas. Thanks.

Dan

At present it returns 'q':
IF C13 =0

I would like the following:
IF C13 =0
AND IF M5:M17 =0
Then return "q"
You say AND, but I think you really mean OR...

=IF(OR(C13=0,M5:M17 =0),"q",IF(SUMIFS(M5:M17,O5:O17,"")=0,"h",SUMIFS(M5:M17,O5:O17,"")))

If I'm wrong, then just change the OR to AND in the above formula.

Thanks very much Rick, yes OR was what I wanted. Thanks again.

Dan

Replies
2
Views
251
Replies
1
Views
283
Replies
17
Views
751
Replies
1
Views
190
Replies
1
Views
270

### Forum statistics

1,203,734
Messages
6,057,059
Members
444,902
Latest member
ExerciseInFutility

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

### Which adblocker are you using?

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

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