Copy link to clipboard
Copied
I have a form that needs to calculate the total amount of a financial adjustment, to include a positive total, a negative total, and a combined total. There are two fields that display this information.
A drop down box with a "+" and "-" (valued at "1" and "-1") respectively (aptly titled "Row1" through "Row10")
A text field for the amount to be entered (formatted to currency) (titled "DollarVar1" through "DollarVar10")
Normally in Excel, I would use something like this:
=SUMIF(B2:B10,">0",C2:C10) |
=(SUMIF(B2:B10,"<0",C2:C10))*-1 |
=SUM(E2:E4) |
I have 0 experience with JS and I have researched and tried to the point where my brain feels like pudding in my head. I have not been having any luck, online tutorials are looking more and more like Greek to me.
I have looked into doing a looping Array, and using If...Else but I feel I have just confused myself at this point as I have not been able to get any results other than verifying my +/- column is translating to 1 and -1. Please help me make sense.
Copy link to clipboard
Copied
While you can do it using a script, of course, you actually don't have to. Instead, you can use the Simplified Field Notation option with this formula:
(Row1*DollarVar1)+(Row2*DollarVar2)+...