Skip to main content
Question

Formula for duration

  • November 11, 2019
  • 0 replies
  • 18 views

So bad at formulas.  How would I change this formula to say if "Completed" or "Cancelled" null otherwise...
I have it working for status = completed

If([Status] = "Completed", null, ToDays(Today() - ([Due Date])) <= 0, null, Today() - ([Due Date]))

------------------------------
Mark Comish
------------------------------
This topic has been closed for replies.

  • Quickbase Staff
  • November 11, 2019
Hey Mark,
If the formula is working correctly otherwise, you should just be able to append it like so:

If([Status] = "Completed" or [Status] = "Cancelled", null, ToDays(Today() - ([Due Date])) <= 0, null, Today() - ([Due Date]))

------------------------------
Freddie Sabbs
Senior Solutions Consultant
Quick Base
fsabbs@quickbase.com
Cambridge MA
------------------------------

Forum|alt.badge.img+1
  • Registered
  • November 11, 2019

Updated your formula:

If([Status] = "Completed" or [Status] = "Cancelled", null, ToDays(Today() - ([Due Date])) <= 0, null, Today() - ([Due Date]))

Alternatively, you could write it with a case statement:
Case([Status],
"Completed", null,
"Cancelled", null,
If(Today() - [Due Date] <= Days(0), null, Today() - [Due Date]))

Edit: Freddie beat me by 1 min, minor tweak to case statement.

------------------------------
Justin Lapier
President (Lead QB Developer)
Synctivate
------------------------------