Skip to main content
Solved

Need help correcting the NaN from my formula

  • November 9, 2022
  • 7 replies
  • 49 views

Forum|alt.badge.img

Hi there! I am looking to add to my formula (below and attached) that when the date is blank or 0 for the field to say “due today”

CURRENT FORMULA
DATETIME_DIFF({SHIP}, NOW(), ‘days’) & " " & IF(DATETIME_DIFF({SHIP}, NOW(), ‘days’) > 0, “days remaining :hourglass_flowing_sand: ”, “days overdue :boom: ”)

Best answer by Jeremy_Oglesby

Hey Jeremy, Could I have your wisdom on another component of the formula?

If the OVERALL STATUS has the status SHIPPED or PARTIALLY SHIPPED, I would like the formula to say “shipped”.


@Nicole_Abascal, try this:

IF(
  FIND("Shipped", {OVERALL STATUS}),
  "shipped",
  IF(
    {SHIP},
    IF(
      DATETIME_DIFF({SHIP}, NOW(), 'days') = 0,
      "due today",
      DATETIME_DIFF({SHIP}, NOW(), 'days') & " " &
      IF(
        DATETIME_DIFF({SHIP}, NOW(), 'days') > 0, 
        "days remaining ⏳", 
        "days overdue 💥"
      )
    )
  )
)

7 replies

Forum|alt.badge.img+18

Hi @Nicole_Abascal

You can wrap the whole thing in another conditional like this:

IF(
  OR(
    DATETIME_DIFF({SHIP}, NOW(), ‘days’) = BLANK(),
    DATETIME_DIFF({SHIP}, NOW(), ‘days’) = 0
  ),
  "due today",
  DATETIME_DIFF({SHIP}, NOW(), ‘days’) & " " &
  IF(
    DATETIME_DIFF({SHIP}, NOW(), ‘days’) > 0, 
    “days remaining :hourglass_flowing_sand:”, 
    “days overdue :boom:”
  )
)

Forum|alt.badge.img
  • Author
  • New Participant
  • November 9, 2022

Hi @Nicole_Abascal

You can wrap the whole thing in another conditional like this:

IF(
  OR(
    DATETIME_DIFF({SHIP}, NOW(), ‘days’) = BLANK(),
    DATETIME_DIFF({SHIP}, NOW(), ‘days’) = 0
  ),
  "due today",
  DATETIME_DIFF({SHIP}, NOW(), ‘days’) & " " &
  IF(
    DATETIME_DIFF({SHIP}, NOW(), ‘days’) > 0, 
    “days remaining :hourglass_flowing_sand:”, 
    “days overdue :boom:”
  )
)

Thank you so much for your help, Jeremy! I didn’t think anyone would respond.

Unfortunately formula did not work and I did not ask my question properly (apologies).

When the SHIP date is empty, I would like the SHIP COUNTDOWN to also be empty. When the SHIP date is the actual day (0 days), I would like the SHIP COUNTDOWN to read “due today.”


Forum|alt.badge.img+18

Thank you so much for your help, Jeremy! I didn’t think anyone would respond.

Unfortunately formula did not work and I did not ask my question properly (apologies).

When the SHIP date is empty, I would like the SHIP COUNTDOWN to also be empty. When the SHIP date is the actual day (0 days), I would like the SHIP COUNTDOWN to read “due today.”


Aaahhh, gotcha, ok… let’s try this then:

IF(
  {SHIP},
  IF(
    DATETIME_DIFF({SHIP}, NOW(), 'days') = 0,
    "due today",
    DATETIME_DIFF({SHIP}, NOW(), 'days') & " " &
    IF(
      DATETIME_DIFF({SHIP}, NOW(), 'days') > 0, 
      "days remaining ⏳", 
      "days overdue 💥"
    )
  )
)

And I just realized that the reason the first formula didn’t work is because I forgot to fix the quotation marks in it to make them all ‘straight’ quotation marks instead of ‘curly’ ones… Airtable’s formula editor is really picky about that.


Forum|alt.badge.img
  • Author
  • New Participant
  • November 9, 2022

Thank you so much, Jeremy! It worked and appreciate your help/patience!!


Forum|alt.badge.img
  • Author
  • New Participant
  • November 10, 2022

Aaahhh, gotcha, ok… let’s try this then:

IF(
  {SHIP},
  IF(
    DATETIME_DIFF({SHIP}, NOW(), 'days') = 0,
    "due today",
    DATETIME_DIFF({SHIP}, NOW(), 'days') & " " &
    IF(
      DATETIME_DIFF({SHIP}, NOW(), 'days') > 0, 
      "days remaining ⏳", 
      "days overdue 💥"
    )
  )
)

And I just realized that the reason the first formula didn’t work is because I forgot to fix the quotation marks in it to make them all ‘straight’ quotation marks instead of ‘curly’ ones… Airtable’s formula editor is really picky about that.


Hey Jeremy, Could I have your wisdom on another component of the formula?

If the OVERALL STATUS has the status SHIPPED or PARTIALLY SHIPPED, I would like the formula to say “shipped”.


Forum|alt.badge.img+18
  • Inspiring
  • Answer
  • November 10, 2022

Hey Jeremy, Could I have your wisdom on another component of the formula?

If the OVERALL STATUS has the status SHIPPED or PARTIALLY SHIPPED, I would like the formula to say “shipped”.


@Nicole_Abascal, try this:

IF(
  FIND("Shipped", {OVERALL STATUS}),
  "shipped",
  IF(
    {SHIP},
    IF(
      DATETIME_DIFF({SHIP}, NOW(), 'days') = 0,
      "due today",
      DATETIME_DIFF({SHIP}, NOW(), 'days') & " " &
      IF(
        DATETIME_DIFF({SHIP}, NOW(), 'days') > 0, 
        "days remaining ⏳", 
        "days overdue 💥"
      )
    )
  )
)

Forum|alt.badge.img
  • Author
  • New Participant
  • November 10, 2022

@Nicole_Abascal, try this:

IF(
  FIND("Shipped", {OVERALL STATUS}),
  "shipped",
  IF(
    {SHIP},
    IF(
      DATETIME_DIFF({SHIP}, NOW(), 'days') = 0,
      "due today",
      DATETIME_DIFF({SHIP}, NOW(), 'days') & " " &
      IF(
        DATETIME_DIFF({SHIP}, NOW(), 'days') > 0, 
        "days remaining ⏳", 
        "days overdue 💥"
      )
    )
  )
)

Brilliant!! That did the trick and it looks incredible. Thank you so so much!