# Re: If or Switch Functions with Dates

Solved
453 0
cancel
Showing results for
Did you mean:
6 - Interface Innovator

I need to compare two date fields to get a specific result. I am not an expert at Airtable, so my explanation isn’t very good :). My base is for tracking training. I need to mark a month “excused” if a person’s hire date is after the meeting date and then mark the month as completed or missed if their hire date is before the meeting date. The hire date is 9/1/2022, and the meeting date is 10/1/2022. That person is required to complete the monthly program. Any suggestions on a formula? - Wendy in Michigan.

1 Solution

Accepted Solutions
16 - Uranus

This is a job for IFs. You didn’t indicate what should happen if Hire is exactly the same as meeting (neither before no after), so I’m assuming the program is required if the dates are the same.

``````IF(
AND({Hire Date}, {Meeting Date}),
IF(
{Hire Date} > {Meeting Date},
"Excused",
IF(
{Completed?} = "yes",
"Completed",
"Missed"
)
)
)
``````

^ This assumes you have a field called {Completed?} which marks whether someone has completed their program.

16 - Uranus

This is a job for IFs. You didn’t indicate what should happen if Hire is exactly the same as meeting (neither before no after), so I’m assuming the program is required if the dates are the same.

``````IF(
AND({Hire Date}, {Meeting Date}),
IF(
{Hire Date} > {Meeting Date},
"Excused",
IF(
{Completed?} = "yes",
"Completed",
"Missed"
)
)
)
``````

^ This assumes you have a field called {Completed?} which marks whether someone has completed their program.