Skip to main content
Solved

Date String: Number of Days as numeric value

  • December 8, 2021
  • 2 replies
  • 20 views

I was wondering if someone was able to help me out.

I am looking use a formula to calculate the amount of days until an item has to be renewed. What I would like is that when it’s nested within an IF statement it is calculated as a VALUE rather than a STRING.

The reason for the IF statement is that when the Expiry Date is empty, no value will show in the “Days Remaining” Field.

Here is the formula:
IF({Passport (Expiry)}=BLANK(),’’, DATETIME_DIFF({Passport (Expiry)},TODAY(),‘days’))

I’m likely missing something really obvious in this regard.

Best answer by ScottWorld

Here’s one way to solve it:

IF(
{Passport (Expiry)}!="",
DATETIME_DIFF({Passport (Expiry)},TODAY(),'days')
)

2 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • Answer
  • December 8, 2021

Here’s one way to solve it:

IF(
{Passport (Expiry)}!="",
DATETIME_DIFF({Passport (Expiry)},TODAY(),'days')
)

  • Author
  • Participating Frequently
  • December 9, 2021

@ScottWorld This worked perfectly. Thanks so much.