I thought you were asking about the operation of ADDEBIT() and ADCREDIT() and the related functions. It sounds like you needed to use ADDEBIT() rather than ADDRONLY() to make the statement work in your circumstance. Then you wouldn't need the IF() statement.
You'll notice that the sample statement contains a Note about how the "trick" is accomplished. A complete familiarity with the 60 or so statements included in the sample data or posted on
www.GreatStatements.com is how to learn about the cool features.
But in my experience, people need a specific problem to solve (as you did), before any of this material becomes very meaningful.