ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I nest an OR function within an AND function? (https://www.excelbanter.com/excel-worksheet-functions/7251-how-do-i-nest-function-within-function.html)

DebbieK

How do I nest an OR function within an AND function?
 
Here is my example - can I do this? What have I done wrong I can't get it to
work.

IF(AND(OR($AD4=€¯A€¯,$AD4=€¯SU€¯,$AD4=€¯GF€¯ ),$AF4<€¯€¯),€¯Updated Allowance is Not
Applicable€¯,"")

JE McGimpsey

When I remove the "smart quotes" from your formula, it works as it
should. What does "I can't get it to work" mean?


In article ,
"DebbieK" wrote:

Here is my example - can I do this? What have I done wrong I can't get it to
work.

IF(AND(OR($AD4=€¯A€¯,$AD4=€¯SU€¯,$AD4=€¯GF€¯ ),$AF4<€¯€¯),€¯Updated Allowance is Not
Applicable€¯,"")


Bernie Deitrick

Debbie,

Your formula as shown:

=IF(AND(OR($AD4="A",$AD4="SU",$AD4="GF"),$AF4<"") ,"Updated Allowance is Not
Applicable","")

worked fine for me. What logic do you want to actually use?

HTH,
Bernie
MS Excel MVP

"DebbieK" wrote in message
...
Here is my example - can I do this? What have I done wrong I can't get it

to
work.

IF(AND(OR($AD4="A",$AD4="SU",$AD4="GF"),$AF4<""), "Updated Allowance is

Not
Applicable","")




Peo Sjoblom

Your formula will check if AD4 is either "A", "SU" or "GF" AND AF4 is not blank

That can be simplified to

=IF(AND(OR($AD4={"A","SU","GF"}),$AF4<""),"Update d Allowance is not
Applicable","")


Regards,

Peo Sjoblom



"DebbieK" wrote:

Here is my example - can I do this? What have I done wrong I can't get it to
work.

IF(AND(OR($AD4=€¯A€¯,$AD4=€¯SU€¯,$AD4=€¯GF€¯ ),$AF4<€¯€¯),€¯Updated Allowance is Not
Applicable€¯,"")



All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com