Question
Add only negative numbers in a set of data
I have an expense report that has fields for "New Charges" and "Credits". Each of these comes from a set of data listed as "Amount.x". (Think a long row of charges named Amount.1, Amount.2... so on).
I want "New Charges" to be the sum of numbers greater than or equal to 0, and "Credits" to be the sum of anything less than 0. How do I write a script for these?
