Code snippet
if(not empty(prop("Start Date")) and not empty(prop("End Date")), floor(dateBetween(prop("End Date"), prop("Start Date"), "days") / 7) * 5 + min(5, mod(dateBetween(prop("End Date"), prop("Start Date"), "days"), 7) + 1 + day(prop("Start Date")) - 1) - max(0, day(prop("Start Date")) - 1), 0)
This robust Notion Formula 2.0 expression precisely calculates inclusive business days. Paste it directly into your formula property, replacing prop("Start Date") and prop("End Date") with your exact date property references, ensuring both start and end dates are counted if they fall on weekdays.
The Syntax Breakdown
if(...): A conditional function that executes different results based on whether a test is true or false. Here, it checks if dates are entered first.not empty(...): Checks that the specified date property is not blank.prop(...): References the value of a specific database property (e.g.,Start Date).and: Logical operator requiring both date properties to be non-empty for the formula to run.floor(...): Rounds a number down to the nearest integer.dateBetween(..., "days"): Calculates the number of whole days between two dates (exclusive end date)./: Division operator.7: Divisor to find the number of full weeks.*: Multiplication operator.5: Multiplier to calculate business days from full weeks (5 working days per week).min(...): Returns the smallest value among the arguments. Used to cap partial-week business days at 5.mod(...): The modulo operator, returning the remainder after division. Here, it finds the remaining days in a partial week.+: Addition operator.1: Added to thedateBetweenremainder for correct partial-week calculation.day(...): Returns the weekday as a number (0 for Sunday to 6 for Saturday). Used to determine where in the week the interval starts.-: Subtraction operator.max(...): Returns the largest value among the arguments. Used to subtract weekend days if the interval starts on a weekend.
Real-World Example: Project Task Duration Tracking
Operations managers use networked calculations to accurately track actual task durations for scheduling, ignoring non-working weekend days. For a task scheduled inclusive, both start and end weekdays count.
| Task | Start Date | End Date | Expected Business Days |
| Market Research | 2026-06-01 (Mon) | 2026-06-05 (Fri) | 5 |
| Competitor Analysis | 2026-06-06 (Sat) | 2026-06-07 (Sun) | 0 |
| Strategy Planning | 2026-06-05 (Fri) | 2026-06-08 (Mon) | 2 |
| Campaign Launch | 2026-06-10 (Wed) | 2026-06-16 (Tue) | 5 |
Apply the provided formula to this data structure, replacing the example property names. For ‘Strategy Planning’, the formula calculates 0 full weeks, with partial week remainder logic determining 2 business days (Friday and Monday), while Saturday and Sunday are correctly excluded. The resulting column would display these exact integer outputs, providing accurate working-day metrics.
Common Errors & How to Fix Them
Formula contains unclosed parentheses: A single missing closing parenthesis)prevents formula compilation. Fix: Ensure all opening parentheses balance with corresponding closing parentheses throughout the entire expression.Undefined property: [Your Property Name]: The specified property reference inprop()does not match any existing property in your database exactly. Fix: Verify that all property references within every prop() call match the capitalization and spelling of your actual date properties precisely.- Logical error / Incorrect count: The formula calculates but produces unexpected results, e.g., including weekend days. Fix: Confirm property names match exactly and validate date inputs to maintain accurate logical adjustments.