Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Struggling with a formula for counting difference between dates

Topic Labels: Formulas
Solved
Jump to Solution
672 3
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello,

I’m trying to make a formula that counts the difference between start date and end date, however if end date is blank calculate the difference between start date, and current date.

Sorry if it sounds simple, i’m very new to airtable!

Thanks
Matt

1 Solution

Accepted Solutions

Hi @Matthew_Grundy - try this:

IF(
{End Date}, 
DATETIME_DIFF({End Date}, {Start Date}, 'days'), 
DATETIME_DIFF(TODAY(), {Start Date}, 'days')
) 

Screenshot 2019-08-19 at 16.28.55.png

JB

See Solution in Thread

3 Replies 3

Hi @Matthew_Grundy - try this:

IF(
{End Date}, 
DATETIME_DIFF({End Date}, {Start Date}, 'days'), 
DATETIME_DIFF(TODAY(), {Start Date}, 'days')
) 

Screenshot 2019-08-19 at 16.28.55.png

JB

Here’s another way to write it, putting the IF function inside a single DATETIME_DIFF:

DATETIME_DIFF(IF({End Date}, {End Date}, TODAY()), {Start Date}, "days")

Works perfectly!
thank you for your help.

Matt