Skip to main content
Participant
April 6, 2016
Question

how do i add and subtract more than one field

  • April 6, 2016
  • 1 reply
  • 587 views

I have 4 fields

field1 is the begining balance

field2 is amount collected (i want to add this to the field1)

field3 is refunds (i want to subtract that from the total of the first two)

field4 is checks written (again I want to subtract this from the top three)

field5 is where I want the ending balance to go

How do I write this.  Do I use script or simplified?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 6, 2016

You can use the simplified calculation script of field5, like this (if I understood you correctly):

(field1 + field2) - (field3 + field4)

lindac88Author
Participant
April 6, 2016

I just tried that.  But the number is not showing up.  It is not giving me an error.  I recopied all the field names.  They don't have any spaces in them.  Should their be spaces between the + and the - in your equation?

try67
Community Expert
Community Expert
April 6, 2016

Spaces are not necessary, but might be helpful.

Check the JS Console for errors (Ctrl+J). Also, keep in mind the script will only "kick in" when you change the value of one of the fields after you enter it.