Skip to main content
Question

Formula question

  • October 26, 2023
  • 0 replies
  • 143 views

Forum|alt.badge.img+2

Hi all,

I am working on an app that calculates loans including deferred loans. Right now, if someone has not paid for a long time and the payment is less than the interest owed, the principle comes back as a negative number rather than a zero. (Current formula is payment amount-interest=principle). I need to make the formula show that there should never be a negative number for principle - just a zero if the amount paid is less than total interest owed. How can I limit the results to not get a negative number?



------------------------------
Jesse Edsell-Vetter
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+9
  • Registered
  • October 26, 2023

Lots of options. I would recommend (1) an if statement or (2) a 'max' function

IF Statement

if( ([Amount] - [Interest]) < 0, 0, [Amount]-[Interest])

if the value of amount - interest is less than 0, return 0 else return amount - interest 

Max function

Max([Amount]-[Interest],0)

This will return 0 in the event that amount - interest is a (neg) value



------------------------------
Chayce Duncan
------------------------------