{"type":"video","version":"1.0","html":"<iframe src=\"https://www.loom.com/embed/934230cf0fdb4066bdbff1a6c2e0a619\" frameborder=\"0\" width=\"1920\" height=\"1440\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>","height":1440,"width":1920,"provider_name":"Loom","provider_url":"https://www.loom.com","thumbnail_height":1440,"thumbnail_width":1920,"thumbnail_url":"https://cdn.loom.com/sessions/thumbnails/934230cf0fdb4066bdbff1a6c2e0a619-00001.gif","duration":190.81,"title":"Total Days Calculation for Leave Dates","description":"Please help me rewrite this formula to split the total amount of leave dates requested based on the year the date is in. \n\nFor example, count the days within the Leave Date range - how many days in 2023 and how many days in 2024. The total days column will now be 2023 Total Days and another column will be added for 2024 Total Days. \n\nThere is currently a formula I am using that counts the total days in the leave date range while subtracting any weekends and 0.5 if a half-day is included in the request. \nThis is the formula:\n if(prop(\"Half Day Included\") == \"Yes\", ((dateBetween(dateEnd(prop(\"Leave Date\")), dateStart(prop(\"Leave Date\")), \"days\") + 1) - 0.5) - ((dateBetween(dateEnd(prop(\"Leave Date\")), dateStart(prop(\"Leave Date\")), \"weeks\") * 2) + min(max((day(prop(\"Leave Date\")) % 7 + (dateBetween(dateEnd(prop(\"Leave Date\")), dateStart(prop(\"Leave Date\")), \"days\") % 7)) - 5, 0), 2)), 1) * if(prop(\"Half Day Included\") == \"No\", (dateBetween(dateEnd(prop(\"Leave Date\")), dateStart(prop(\"Leave Date\")), \"days\") + 1) - ((dateBetween(dateEnd(prop(\"Leave Date\")), dateStart(prop(\"Leave Date\")), \"weeks\") * 2) + min(max((day(prop(\"Leave Date\")) % 7 + (dateBetween(dateEnd(prop(\"Leave Date\")), dateStart(prop(\"Leave Date\")), \"days\") % 7)) - 5, 0), 2)), 1)"}