Skip to main content

Calculating Date Differences

  • March 14, 2022
  • 1 reply
  • 0 views

Forum|alt.badge.img+3

I’m trying to use a formula to calculate the number of years between two dates, namely the start and end dates of a job/position – while accounting conditionally for when ether of those fields are blank.

Thought myself rather clever with this formula, but sadly it’s not working.

Can anyone help me figure out what’s wrong?

IF(
    {Position Start}=BLANK(),
        "",
    DATETIME_DIFF(
        {Position End},
            IF(
                {Position End}=BLANK(),
            TODAY(),
        {Position End}),
        'years'
    )
)

1 reply

Ben_Young1
Forum|alt.badge.img+20
  • Brainy
  • 520 replies
  • March 14, 2022

Hey @Shawn_Carrie!
Welcome in!

Try this and let me know if it works:

IF(
    {Position Start},
    DATETIME_DIFF(
        {Position End},
        IF(
            {Position End},
            {Position End},
            TODAY()
        ),
        'years'
    )
)

Reply