Skip to main content
Question

Formula that returns 1 or 0 based on how many minutes left during working hours until a certain date


Forum|alt.badge.img

Hey! We have a difficult airtable formula to create that outputs 1 or 0 based on how soon a date is. Could you tell me if you could help?
This is the problem:
We have a variable called {Deadline}, which is the deadline to respond to a job. We have a job board linked to airtable. However, this is also the deadline for us as recruiters do our work with the applicant. It's still up on the website even minutes before the deadline. So if someone responds, it's too late, which is frustrating for them. But we still would want them to apply in case we have the time.

So we need AT LEAST 8 hours (a 9:00 until 17:00 workday) * 60 minutes (for more accuracy) = 480 minutes to do our recruitment work. So we need a formula that says: IF we have less than or equal to 480 minutes of work during work hours until the deadline, the formula should be 1 (indicating to us that we should give a warning on the website when someone applies that we might not make it but will try). If it is already closed it should also just be 1 (it would be off the website, but just in case).

We work 9:00 until 17:00 Amsterdam time (The Netherlands) Monday till Friday. The deadlines can be anything: Thursday 23:59 (in which case it should be 1 at 9:00 that thursday, cause from then on, we have less than 480 minutes till 17:00).

If it closes on monday 14:00, then we have 5*60 minutes on monday and still need 3*60 minutes on the previous workday, which is friday, so it should be 1 from friday 14:00 onwards.

Let me know if anyone can help!

2 replies

TheTimeSavingCo
Forum|alt.badge.img+18

Hmm, I don’t know that I’ll have the time to be able to help with this one, but if you could create some test data and output it would help anyone that’s assisting you with this a lot.  I’ve put something together here for you to start off with, and if you could add to it it’d make much easier to help you!

 


Milan_Automable
Forum|alt.badge.img+3

Hi ​@Timo12 ,

This is indeed a bit too complex for a single formula. I’m not sure if I’ll have time to try to set this up, but my general approach would be to break it up into pieces, probably along the lines of:

 

  1. Minutes remaining today - minutes until the MIN of the deadline and 17:00 today
  2. Minutes on Deadline day - minutes between 9:00-MIN({Deadline}, 17:00) on the day of the deadline
  3. Full Workdays Until Deadline - this would be a combination of SWITCH (or nested IF) and WEEKDAY, to determine if there’s any workdays between the deadline and today.

And then the final Should Warning, which is 0 if there are any full workdays, otherwise it checks if the two Minutes field add up to 480 or less.

And you’d probably need to handle some edge cases, like when the deadline is already past; either within the final formula or other helpers.

Best, Milan - Automable.AI Free Airtable consultation


Reply