Hi there, having a difficult time writing a formula, for an employee timesheet.
Currently, I am the using DATETIME_DIFF formula to calculate the total amount of hours worked within a 14-day period. I’m using two date/time fields for each day (ex: Day 1 - Start, Day 1 - End), so my formula is embarrassingly long:
DATETIME_DIFF({Day 1 - End}, {Day 1 - Start}, ‘hours’)+DATETIME_DIFF({Day 2 - End}, {DAY 2 - Start},‘hours’)+DATETIME_DIFF({Day 3 - End}, {Day 3 - Start},‘hours’)… and so on 11 more times.
My issue is, we have some employees that don’t work the full 14 days, so I need a formula that will calculate their total hours, and if some START/END fields are left blank, it will result as a “0” in the overall calculation.
I am a novice when it comes to formula writing, and have just started using Airtable this Summer. Any help or guidance is appreciated.
Thanks!