Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Aug 22, 2023 12:43 PM
Hi all,
I'm trying to create a formula to add on to a scheduling template I'm using. There is already a field for Monday hrs, Tuesday Hrs, etc. Formatted like this:
Aug 22, 2023 01:20 PM
And actually, upon more investigation, the above mentioned formula for the total daily hours is faulty - It can't divide into half hours; for some reason it defaults to round down to the closest hour, which is problematic. Surprising for a template that airtable provides. Anyone know how to fix this?
Aug 22, 2023 04:20 PM
Hi @Jay108 ,
For example, something like this
IF({Monday Start} = BLANK(), 0,
IF(DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60 > 5,
DATETIME_DIFF({Monday End}, DATEADD({Monday Start}, 30, "minutes"), 'minutes')/60,
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60)
)
Aug 23, 2023 11:16 AM
Thanks so much @Sho
Using the minutes / 60 worked great for getting the correct values. The above formula didn't work, but I just used this in the regular "Monday Hrs" field and it corrected the values:
Now, to deduct the half hour lunch, I created a separate field "Pay Hours" and I tried this: