I created a macro that provides the weekends and bank holidays for the next 272 years. This is great for forecasting datasets or anything that needs next business day. I've found it very helpful!!!
@Kilbyflow_Designer Its very helpful I believe.Just searched and found out that Halloween is not a public holiday is US. 😁
@Kilbyflow_Designer good one. i suggest few area to improve.
1. filter out the non-holiday? it not fit the holiday generator purpose, because it always used to joins to remove date. 2. can it have dynamic for range of the year? it take too long for whole 272 years. so get a min and max year from input i.e. list date, will help to reduce the process time.
3. why third monday field is used also for 1st monday, 2nd monday, last monday and last thursday. it not clear if someone want to study.
4. try to use tonumber(datetimeformat([date],"%u")) for mon=1, tue=2. and datetimetrim([date],"firstOfMonth") or datetimetrim([date],"lastOfMonth") to simplify the formula.
Nice suggestions already They definitely improve clarity and performance. I’d add a few more areas to consider:
1. Separate logic from dataConsider splitting the holiday rules from the date-generation logic. A small “holiday rules” table (holiday name, rule type, month, weekday, occurrence, etc.) would make the system easier to maintain and extend.
2. Add comments / documentationSome formulas (especially weekday calculations) can be hard to follow later. Short comments explaining the intent would help others understand the logic quickly.
3. Parameterize holidaysInstead of hardcoding holidays, allow them to be configurable so new holidays or country-specific ones can be added without changing the core logic.