0

I'm trying to make a days remaining formula that wont show any negative numbers.(it will stop counting after 0) what I created is this:

End_date__c  -  TODAY()
IF (OR (Days_remaining__c <= 0, ISNULL(Days_remaining__c)), 0, Days_remaining__c -1)

The syntax shows: Error: Syntax error. Extra IF I have no idea how to fix it. I will be very happy to get some help on this one. Thank you very much :)

1 Answer 1

0

I'm guessing that Days_remaining__c is the field for this formula (which cannot be referenced by itself). If that's right then you probably just need a formula like:

IF(End_date__c < TODAY(), 0, End_Date__c - TODAY())

For there to be negative days remaining the end date must be before "today", in which case this returns 0. Otherwise this returns the difference between the end date and "today".

NB: I've assumed that End_date__c always has a value.

2
  • You got it right Phil. Thank you so much! Commented Feb 7, 2023 at 8:54
  • @TomShlomoTidhar is there a reason you removed your "best answer" mark? Note that I did make a small change after you posted your above comment - I realized I had a comparison the wrong way round.
    – Phil W
    Commented Feb 13, 2023 at 22:34

You must log in to answer this question.

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