Correct IF, AND syntax

ddub25

Well-known Member
Joined
Jan 11, 2007
Messages
625
Office Version
  1. 2019
Platform
  1. Windows
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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Are there any chances that B11 will be negative?
 
Upvote 0
No, B11 will always be either empty or positive. Thanks.

Dan
 
Upvote 0
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.
 
Upvote 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,"")))
 
Upvote 0
Try This,

Code:
=IF(AND(B11>0,SUMIFS(N5:N16,Q5:Q16,"")=0),"h",IF(OR(B11=0,B11=""),"q","Condition Variance"))
 
Upvote 0
Thanks for both of your help. Solved my problem. Thanks.

Dan
 
Upvote 0
=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
 
Upvote 0
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.
 
Upvote 0
Thanks very much Rick, yes OR was what I wanted. Thanks again.

Dan
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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