Oh my gosh, thank you! I'd tried everything, but making some
adjustments, this is what worked: Total due traveler:if (TotalExpenses
gt Advances) thenSum(TotalExpenses-Advances)else 0endif Total due
university:if (TotalExpenses lt Advances)
thenSum(Advances-TotalExpenses)else 0endif Thanks again!
I have a travel reimbursement form with numeric fields for all expenses
and cash advances. I have two fields for totals: one for "Amount Due
Traveler" and one for "Amount Due University." I need for the Total
Expenses and Advances fields to be compared, and if Expenses are greater
than Advances, the Amount Due Traveler should sum and leave the other
field at $0. If the opposite is true, the Amount Due University should
sum and leave the other field at $0. I've tried different if then else
Thanks for your response. Unfortunately, it didn't work, and it produced
an inaccurate result.Here's what I did:PV (PaymentAmount, InterestRate /
PaymentsPerPeriod, TotalPayments)if (InterestRate > 0)then$ =
(PaymentAmount * InterestRate) / (PaymentsPerPeriod *
TotalPayments)else$ = ""endifThe formula is wrong, so it produced the
wrong result, and the error appeared for every field except
PaymentAmount. Weird.So, I tried this:PV (PaymentAmount, InterestRate /
PaymentsPerPeriod, TotalPayments)if ...
The calculation for the PresentValue field is PV
(PaymentAmount.rawValue, InterestRate.rawValue /
PaymentsPerPeriod.rawValue, TotalPayments.rawValue). All of these fields
have to have a value (user-entered) to calculate the PresentValue field.
The calculation works just fine, it's just that when you place a value
in InterestRate, before placing a value in PaymentsPerPeriod (by which
InterestRate is divided), you get the error. So, I need to be able to
tell it to only calculate when InterestRate ...
Update: I did get the form to not show the error upon opening the form,
but it still shows the same error when tabbing out of the InterestRate
field (after entering a value) - and only this field. (I had originally
had "0" as the default value for all fields, but once I removed that,
the error now only appears when tabbing out this field.)I'm not really
savvy with formcalc yet, so I'd love any help you can offer. Thanks so
I've tried finding a solution to this on my own using other examples
from previous forum posts, but nothing has worked. I have a form
containing some fields that perform a simple "present value"
calculation. The calculation works, but when you open the form, I
receive the following error:Of course, all of the fields involved in the
calculation are blank when the form opens, so there's nothing to
calculate, which is, I think, what is causing this error. Is there some
formcalc script I can use to ...