Help

The Airtable Community will undergo scheduled maintenance on September 17 from 10:00 PM PST to 11:15 PM PST. During this period, you may experience temporary disruptions. We apologize for any inconvenience and appreciate your understanding.

Calculating Date Differences

Topic Labels: Formulas
757 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Shawn_Carrie
5 - Automation Enthusiast
5 - Automation Enthusiast

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 1

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'
    )
)