I need to figure out how to get the proper entry into a cell based on two other cells. Specifically:

Cell Q4 needs to display text letter X, text letter E, or blank. 0 (zero) is acceptable since they are suppressed.

If DP4 is X then Q4 needs to be X.
If DP4 is blank and DS4 is X then Q4 needs to be E.
If both DP4 and DS4 are blank then Q4 needs to be blank or zero.
If both DP4 and DS4 are X then Q4 needs to be X.

I'm lost in how to accomplish this.

Thanks for any help!
Tom