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

IF formula with date

418 2
Showing results for 
Search instead for 
Did you mean: 

Hi, I’m super new to using formulas. I’d like to do an IF formula for my “Published date” column with the “assigned week” column.

So if the dates are less than 2 weeks time it will get “first two weeks” if its more than two weeks it will get the “last two weeks”.

My formula:

IF({Published date}) < 14, “first two weeks”) ,IF({Published date}) > 14,“last two weeks”)

Please advised… Thanks in advance!

2 Replies 2

You’re probably looking for DATETIME_DIFF. Give this a try:
IF(DATETIME_DIFF({Published date}, TODAY(), "days") < 14, "first two weeks", "last two weeks")

That will check the number of days between {Published date} and Today, but it’s possible to replace TODAY() with another Date field.

Hope that helps.

Hey thanks, it works! new formula to play around with. I’m going to keep it to a month to month basis because anything that’s more than 14 days shows as “last two weeks”. :slightly_smiling_face: