Try:

Formula: copy to clipboard
=IF(OR(SIGN(U5)<>SIGN(AA5),AA5>U5),"ERROR",IF(U5<0,"LOAN","DEPOSIT"))