Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Re: IF formula with date

65 1
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: