How to Calculate Working Days With a Notion Formula
🔍 WiseChecker

How to Calculate Working Days With a Notion Formula

Notion does not include a built-in function to calculate the number of working days between two dates. Business users often need this number for project timelines, sprint planning, or invoice tracking. This article explains how to build a formula that excludes weekends and optionally handles holidays. You will learn the exact formula structure, how to adjust it for different workweeks, and common pitfalls to avoid.

Key Takeaways: Calculate Working Days in Notion

  • dateBetween() + dateSubtract() formula: Counts days between two dates and subtracts weekends using a weekday index check.
  • prop(“Holidays”) rollup: Add a separate database for holidays and roll up the count to exclude them from the working day total.
  • prop(“Start Date”) and prop(“End Date”) properties: Both must be Date type properties for the formula to work correctly.

How the Notion Working Days Formula Works

The core logic calculates the total days between two dates, then subtracts the number of weekend days in that range. Notion formulas do not have a native NETWORKDAYS function like Excel. Instead, you use the dateBetween() function to get the total days and then apply a mathematical calculation to count Saturdays and Sundays.

The formula assumes a Monday-through-Friday workweek. If your workweek is different, you must adjust the weekday index numbers. In Notion, the weekday() function returns 0 for Sunday, 1 for Monday, continuing to 6 for Saturday.

Before writing the formula, ensure your database has two Date properties: one named Start Date and another named End Date. The formula property must be of type Formula, not Date or Number.

Steps to Write the Working Days Formula

  1. Create the Date properties
    In your Notion database, add a property called Start Date and set its type to Date. Add another property called End Date and set its type to Date. Enter sample dates in at least one row to test the formula.
  2. Add a Formula property
    Click the + button in the last column of the database. Select Formula from the property type list. Name it Working Days.
  3. Enter the base formula
    Click inside the formula editor and paste this code:

    let(totalDays, dateBetween(prop("End Date"), prop("Start Date"), "days") + 1,
    let(startDay, prop("Start Date").weekday(),
    let(endDay, prop("End Date").weekday(),
    let(fullWeeks, floor((totalDays - (7 - startDay) - endDay + 1) / 7),
    let(weekendDays, fullWeeks 2 + if(startDay == 0, 1, 0) + if(endDay == 6, 1, 0) + if(startDay > endDay and startDay != 0 and endDay != 6, 2, 0),
    totalDays - weekendDays
    ))))

  4. Verify the formula syntax
    Notion highlights syntax errors in red. If you see an error, check that property names match exactly, including spaces and capitalization. The formula uses let() to define variables, which keeps the code readable and avoids repeating calculations.
  5. Test with known date ranges
    Set Start Date to a Monday and End Date to the following Friday. The result should be 5. Set Start Date to a Friday and End Date to the next Monday. The result should be 2, because Saturday and Sunday are excluded.
  6. Adjust for a different workweek
    If your weekend is Friday and Saturday, change the weekend day numbers. Replace startDay == 0 with startDay == 5 (Friday) and endDay == 6 with endDay == 4 (Thursday). Test with known dates to confirm the count.

How to Exclude Holidays From the Working Days Count

Notion formulas cannot directly reference a list of dates from another table. To exclude holidays, create a separate database for holidays and use a Rollup property to count how many holidays fall within the date range.

  1. Create a Holiday database
    Make a new database called Holidays. Add a Date property called Holiday Date. Enter each holiday as a separate row with its date.
  2. Link the Holiday database to your main database
    In your main database, add a Relation property. Connect it to the Holiday database. For each task or project row, link the holidays that fall within its date range. This step is manual unless you use a third-party automation.
  3. Create a Rollup property
    Add a new property in your main database. Set its type to Rollup. Configure it to roll up the Holiday Date property from the linked Holiday database. Set the calculation to Count All. Name this property Holiday Count.
  4. Subtract holidays from working days
    Edit the Working Days formula. At the end of the formula, subtract the holiday count. The final line becomes: totalDays - weekendDays - prop("Holiday Count"). If a holiday falls on a weekend, it is already excluded, so the count may be slightly off. To fix this, ensure you only link holidays that fall on weekdays, or use a more advanced formula that checks each holiday date against the weekday.

Common Mistakes When Calculating Working Days

Formula returns a negative number

This happens when the End Date is earlier than the Start Date. The formula assumes Start Date is before End Date. Add an if statement at the beginning to swap the dates or return 0. For example: if(dateBetween(prop("End Date"), prop("Start Date"), "days") < 0, 0, [rest of formula]).

Weekday numbers are wrong for your region

Notion uses the JavaScript weekday numbering: Sunday is 0, Monday is 1, through Saturday as 6. If your workweek starts on Sunday, adjust the weekend checks. For a Sunday-through-Thursday workweek, change the weekend day checks to Friday (5) and Saturday (6).

Formula does not update when dates change

Notion formulas recalculate automatically when referenced properties change. If the formula does not update, check that the property names in the formula match exactly. A trailing space or a misspelled property name causes the formula to fail silently.

Notion Working Days Formula vs Manual Count

Item Notion Formula Manual Count
Speed Instant after setup Minutes per range
Accuracy 100% with correct formula Prone to human error
Holiday handling Requires separate database and rollup Easy to overlook
Custom workweek Adjustable with formula edits Requires mental math

Notion formulas save time and eliminate counting mistakes. The upfront effort of writing the formula pays off when you manage multiple date ranges across a project.

You can now calculate working days in Notion using the formula provided. Test it on a sample database with known date ranges to confirm the output. For advanced use, integrate the Holiday database and adjust the weekend day numbers to match your company calendar. The formula can also be extended to count only specific weekdays by modifying the weekday index checks.