Yes, but I think we'd need to understand the logic better.
How do you define that A and B are true ?
If they are both true, what if C>+D is also true ?
If the decision process is as follows, then you can write a formula for it -
If A AND B are both true, return X.
If A AND B are not both true, but C>+D is true, return Y.
Otherwise, return Z.
If this isn't the correct logic, you can still write a formula for it, but you'd need to be clear about what the logic is.