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

Using formulas to condition fields

Topic Labels: Formulas
219 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I am setting up a data base to track our job postings on various job sites. For a given job posting, we have a “status” field (this is the one I want to conditionally format), a “date posted” field, and a “date expires” field. The date posted field and the date expired field will be manually populated at the same time, once the posting goes up, although they obviously won’t have the same date.

What I want to happen in the status field is: (1) when the date posted is blank, I want ‘need to post’ to appear. (2) when the date posted is populated and the expiration date has not passed, I want ‘posted’ to appear. (3) when the date posted is populated and the expiration date has passed, I want ‘expired’ to appear.

Here is what I have…

IF({Date Posted},AND(DATETIME_DIFF(TODAY(),{Date Expires})<=0,‘ :white_check_mark: ’,IF({Date Posted},AND(DATETIME_DIFF(TODAY(),{Date Expires})>=0,‘ :x: EXPIRED’,IF({Date Posted}=0, ‘ :raised_hand: Need to Post’)))))

Airtable accepts this formula, but no statuses are showing up. Can you help!?

1 Reply 1

It looks like you’re missing the unit specifier for your DATETIME_DIFF functions.

If you’re looking for the difference in days, then use the word ‘days’ (in single quotation marks) like this:

DATETIME_DIFF(TODAY(),{Date Expires},'days')