SOLVED

SharePoint calculated column formula help

New Contributor

I have a calculated column formula performing a basic subtraction operation between two other columns; call it "cost" column and "account balance" column.  The product of the calculated column is displayed in a "remaining cost" column. The intention is to trigger a flow if the cost exceeds the account balance, showing a positive value in the remaining balance column. 

For example:

 

Cost = $12.  Account balance =$10.  Remaining cost (calculated column) = $2

 

The formula looking like,  =[Account balance]-[Cost]

 

However, if the account balance is greater than the cost, the Remaining cost is displayed as a negative number.  

 

Cost = $10.  Account balance = $12.  Remaining cost = ($2)

 

Is there a way to perform the calculation, but limit the minimum value to be zero?  

 

2 Replies
best response confirmed by jacob_n (New Contributor)
Solution

Try the following:
=IF([Account balance]-[Cost]<0,0,[Account balance]-[Cost])

If this resolves your issue, please mark it as the answer. Thank you!

@Don Kirkham Thanks for the reply.  That worked well.