Calculated Fields based on Shown Fields Only
I am creating a timesheet in Adobe Acrobat Sign that requires automatic daily and weekly hour calculations based on lunch breaks. For each day, users enter the date, enter the start time (h:nn tt), select their lunch length from a drop-down menu (none, 30 min, 45 min, 60 min), and enter the end time (h:nn tt).
In order to get the total daily hours calculation, I have created four different calculated fields on top of each other set to show only when the specific item from the lunch length drop-menu is selected. This works as expected and shows the accurate number of hours worked. I am using a variation of the following formula that as shown is for a Monday where a 30 minute lunch was selected.
(dateDiff("n", if([Monday Stop Time 1]<[Monday Start Time 1], [Monday Stop Time 1] + 1, [Monday Stop Time 1]), [Monday Start Time 1]) / 60) - 0.50
I am unable to get the total weekly hours calculation to work, though. Instead of adding the seven shown fields for each day in the week, it adds all 28 fields. I am using the following formula. Please note not all fields are included in this example, but you can see the pattern.
[Monday Hours No Lunch 1] + [Monday Hours 30 Lunch 1] + [Monday Hours 45 Lunch 1] + [Monday Hours 60 Lunch 1] + [Tuesday Hours No Lunch 1] + [Tuesday Hours 30 Lunch 1] + [Tuesday Hours 45 Lunch 1] + [Tuesday Hours 60 Lunch 1] + [Wednesday Hours No Lunch 1] + [Wednesday Hours 30 Lunch 1] + [Wednesday Hours 45 Lunch 1] + [Wednesday Hours 60 Lunch 1] ….
I included all possible options because I cannot predict what lunch length a user will pick for each day. How can I make it so only the seven shown calculated fields are added for the total weekly hours? Thank you for your expertise, support, and guidance.
