Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Put a value when event occur between two dates

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

Hi There,

I’m having a hard time figuring out how to put a value when a subscription occurs between to date :

I’ve tried this :arrow_down:

IF(
{Date} < ‘30/09/2020’,
“TPP Test phase”,
IF(
{Date} < ‘31/12/2020’,
“TPP OND”,
IF({Date} < ‘31/03/2021’,
“TPP JFM”,
IF({Date} < ‘30/06/2021’,
“TPP AMJ”
)
)
)
)

But it won’t work at all. Someone could help please ?

1 Solution

Accepted Solutions

Welcome to the community, @Florence_Dorsile!

The list of functions that you can use in Airtable is on this page:

In your case, you would use the IS_BEFORE function (and optionally, the DATETIME_PARSE function):

IF(
    IS_BEFORE({Date}, DATETIME_PARSE('30/09/2020','DD/MM/YYYY')),
    "TPP Test phase",
IF(    
    IS_BEFORE({Date}, DATETIME_PARSE('31/12/2020','DD/MM/YYYY')),
    "TPP OND",
IF(    
    IS_BEFORE({Date}, DATETIME_PARSE('31/03/2021','DD/MM/YYYY')),
    "TPP JFM",
IF(    
	IS_BEFORE({Date}, DATETIME_PARSE('30/06/2021','DD/MM/YYYY')),
	"TPP AMJ" 
))))

If you’re already in a country where the dates are formatted in DD/MM/YYYY, you wouldn’t need to use the DATETIME_PARSE part of the function, but to avoid any ambiguity whatsoever (regardless of country), you would want to use the DATETIME_PARSE function.

Hope this helps! If this answers your question, could you please mark this comment as the solution to your question? This will help other people who have a similar question. :slightly_smiling_face:

See Solution in Thread

2 Replies 2

Welcome to the community, @Florence_Dorsile!

The list of functions that you can use in Airtable is on this page:

In your case, you would use the IS_BEFORE function (and optionally, the DATETIME_PARSE function):

IF(
    IS_BEFORE({Date}, DATETIME_PARSE('30/09/2020','DD/MM/YYYY')),
    "TPP Test phase",
IF(    
    IS_BEFORE({Date}, DATETIME_PARSE('31/12/2020','DD/MM/YYYY')),
    "TPP OND",
IF(    
    IS_BEFORE({Date}, DATETIME_PARSE('31/03/2021','DD/MM/YYYY')),
    "TPP JFM",
IF(    
	IS_BEFORE({Date}, DATETIME_PARSE('30/06/2021','DD/MM/YYYY')),
	"TPP AMJ" 
))))

If you’re already in a country where the dates are formatted in DD/MM/YYYY, you wouldn’t need to use the DATETIME_PARSE part of the function, but to avoid any ambiguity whatsoever (regardless of country), you would want to use the DATETIME_PARSE function.

Hope this helps! If this answers your question, could you please mark this comment as the solution to your question? This will help other people who have a similar question. :slightly_smiling_face:

Thanks a lot !!! :hugs: