Morning @phipps0218 and @WarrenBelz ,
You both helped me resolve my DateDiff issue and your solutions are working perfectly! However, another option, Work Travel, was added to the 'Reason for Request' Choice column. My Ops Manager does not want Work Travel calculated as PTO. When Work Travel is selected the '# of Days Requested' field should remain 0 or blank. I have tried adding the If statements below, but none work as needed. I've added them to the beginning of the formula, middle and end and no change. Can I incorporate this request into the existing formula or would it be better to create a separate field for the Work Travel option?
Thanks again for your help!
Patti
Existing formula on Default property of the '# of Days Requested' field:
If(
IsBlank(dcStartDate.SelectedDate) || IsBlank(dcEndDate.SelectedDate),
0,
With(
{
wHol: Filter(
CalHolidays,
HolidayDate >= dcStartDate.SelectedDate && HolidayDate <= dcEndDate.SelectedDate
)
},
RoundDown(
DateDiff(
dcStartDate.SelectedDate,
dcEndDate.SelectedDate,
Days
) / 7,
0
) * 5 + Mod(
5 + Weekday(dcEndDate.SelectedDate) - Weekday(dcStartDate.SelectedDate),
5
) - CountRows(wHol) + 1
)
)
If statements I've tried to incorporate into the existing formula:
- If(LeaveReason.Selected.Value = "Work Travel", "DaysRequested", 0)
- If("Work Travel" in LeaveReason.Selected.Value,true,false, 0)
- If(LeaveReason.Selected.Value, "Work Travel"),true, 0)
