# Return "YES" if cell H2 >12 and cell P2=Open - If no match return "NO"

• I am trying to set up a formula to return the text Yes if two conditions are met and No if they are not.

Column H contains a value between 1 to 25
Column P contains text of either "Open" or "Closed"

The formula should return "YES" if the value in H is greater than or equal to 12 and column P has the text "Open"
If column P has the text "Closed" then the formula needs to return "No"

I have used this site for years as it's a valuable resource but have always found the answers I need via other posts. Any help would be greatly appreciated!

• Re: Return &quot;YES&quot; if cell H2 &gt;12 and cell P2=Open - If no match return &quot;NO&quot;

Try this:

=IF(AND(H2>11,P2="Open"),"Yes","No")

Ali

Enthusiastic self-taught user of MS Excel who's always learning!
If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

• Re: Return &quot;YES&quot; if cell H2 &gt;12 and cell P2=Open - If no match return &quot;NO&quot;

Fantastic! Thanks a million.

As ever with formula's once you have something that works you realise you didn't think all the variables through and ask the right question in full! I have pasted that formula down the relevant column and it works great however is there a way to also include in the formula if cell P2 is blank to leave the cell blank? Sorry to be such a pain.

• Re: Return &quot;YES&quot; if cell H2 &gt;12 and cell P2=Open - If no match return &quot;NO&quot;

Of course!

=IF(P2="","",IF(AND(H2>11,P2="Open"),"Yes","No"))

Ali

Enthusiastic self-taught user of MS Excel who's always learning!
If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

• Re: Return &quot;YES&quot; if cell H2 &gt;12 and cell P2=Open - If no match return &quot;NO&quot;

Perfect! I am a little over chuffed with this, clearly I need to get out more... Thanks again AliGW!

• Re: Return &quot;YES&quot; if cell H2 &gt;12 and cell P2=Open - If no match return &quot;NO&quot;

You're welcome! The fact that I know these things shows that I really don't get out enough.

Ali

Enthusiastic self-taught user of MS Excel who's always learning!
If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!