We have a formula field in a custom object that does not calculate properly. Although the value of the field in the if condition is not null, the result is always zero. The formula is:

if(field1__c!=null,field2__c - field3__c,0)

1 Answer 1


try changing it to

IF(ISBLANK(field1__c), 0 , field2__c - field3__c)

its always better to use the inbuilt formula functions..

you can refer this link to understand the difference between ISNULL and ISBLANK functions

  • Thanks Vamsi That helped. Any idea why that wouldn't work without giving any errors?
    – Jorjani
    Commented Jan 8, 2016 at 1:59
  • I think != null doesn't cover empty strings ( != '' ) ISBLANK covers both the checks. Commented Jan 8, 2016 at 2:16
  • More to the point, text fields are not NULL in formula terminology. Only other non-text types, like numbers and dates, can be null. ISBLANK, however, covers both the null case (like dates and numbers) as well as empty text strings.
    – sfdcfox
    Commented Jan 8, 2016 at 5:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .