Calculating business days in Salesforce comes down to counting the weekdays between two date fields and dropping every Saturday and Sunday from the result — Salesforce ships no built-in NETWORKDAYS-style function, so you build the math yourself inside a formula field, a Record-Triggered Flow, or a small Apex class. The classic declarative pattern uses the MOD function to detect the starting weekday and a CASE expression to subtract the weekend days from the inclusive date span, returning a plain Number you can place on page layouts, in reports, and inside validation rules. For an ad-hoc check outside the platform — confirming a deadline, sanity-checking a Flow output, or planning a sprint — a browser-based business days calculator returns the same inclusive count in two clicks and lets you feed in optional holidays as a comma-separated list. Both routes end up agreeing on the count of Monday-through-Friday days, including the start and end dates whenever they themselves fall on weekdays.
That single fact — the answer is the number of weekdays inside a range, with the endpoints counted when they are weekdays — is what ties every approach below together. The differences are mostly about where the math lives (in Salesforce, in your browser, or in your head) and how much maintenance you want to take on.

What Counts as a Business Day in Salesforce
A business day in Salesforce reports is a Monday, Tuesday, Wednesday, Thursday, or Friday that sits between two dates. Saturdays and Sundays are always excluded. The start date and the end date are both counted when they land on weekdays — this matches the inclusive behaviour of spreadsheet NETWORKDAYS functions, so a Case opened Monday morning and closed Friday afternoon of the same week shows 5 business days, not 4.
Public holidays are a separate layer. Salesforce has no native holiday calendar, so anything that should drop a New Year's Day or a regional public holiday from your count has to come from a custom object, a hard-coded CASE list, or an external lookup. A pure formula field cannot reach into a holiday table on its own, which is the practical reason many teams move to Flow once holidays enter the picture.
Building a Business-Days Formula Field
The fastest way to expose a business-day count on a record is a formula field. It runs on every read, so it always reflects the latest values of the underlying date fields and requires no scheduled jobs.
- In Setup, open Object Manager and pick the object that holds your two date fields (Case, Opportunity, custom Order object, and so on).
- Choose Fields & Relationships → New, then select Formula as the field type.
- Set Formula Return Type to Number and Decimal Places to 0.
- Build the body of the formula using MOD, CASE, and the subtraction of the two date fields. The pattern is: compute the inclusive calendar span (end minus start plus one), detect the start weekday with MOD(start − anchor, 7), and use CASE to subtract the right number of weekend days from the leftover tail of the range.
- Click Check Syntax, give the field a label such as Business Days Open, and save.
- Add the new field to the relevant page layouts and report types so it shows up next to the dates it depends on.
The actual formula is the only part that needs care. A common pattern subtracts whole weekend weeks first (every 7 calendar days contributes exactly 2 weekend days) and then trims the leftover tail by checking which weekday each boundary lands on. The result is the inclusive count of weekdays in the span.
Formula fields are quick and declarative, but they recompute every time the record is read and they cannot look up a holiday table without help. For most teams this is fine when the question is simply "how many weekdays elapsed between two stored dates".
Doing It in a Record-Triggered Flow
When you need holidays, business-hours logic, or a stored count that you can query, a Record-Triggered Flow is usually the cleanest in-platform option. The Flow runs once when the record is created or updated, does the weekend math in a single Assignment element, and writes the result into a Number field that reports and list views can read directly.
- From Setup, open Flows and create a new Record-Triggered Flow.
- Set the entry condition so the Flow fires when one of the two relevant dates is created or changes.
- Add an Assignment element that computes the inclusive calendar span and subtracts the weekend days, using the same MOD-and-CASE pattern as the formula field. The advantage here is that you can use intermediate variables and debug the result with the Debug Flow tool before you go live.
- If holidays matter, add a Get Records element that pulls matching rows from a custom Holiday__c object, then loop through them and subtract when each holiday falls inside the date range on a weekday.
- Add an Update Records element that writes the final count back to a Number field on the record.
- Save and activate the Flow, then test it with a known date pair before relying on it in production.
Flow is more work to set up than a formula field, but it buys you a stored value, easier debugging, and a clean place to attach holiday logic.
When You Need Holidays in the Count
Salesforce does not include a public-holiday calendar out of the box. Any holiday logic you need has to be supplied by you. Three patterns cover most cases:
- Hard-coded list. Use a CASE expression in the formula to subtract a known holiday that falls on a weekday inside the range. Cheap and fast, but it needs editing every year.
- Custom object. Create a Holiday__c object with a Date field and have the Flow or Apex loop query rows that fall between the two dates. Updating holidays for a new year is then a matter of inserting rows.
- External service. Call out to a holidays API from an Apex class or a future method and cache the result. Useful for multi-region teams, but it pulls an external dependency into your counting logic.
Whatever route you take, only count holidays that fall inside your date range and on a weekday. A New Year's Day that lands on a Saturday does not change the business-day count, because Saturday was never going to be a working day anyway. A date listed twice in your holiday table should still only subtract one day.
Quick Check Outside Salesforce
When you need the answer fast — estimating a project deadline before writing the formula, sanity-checking the result of a Flow, or planning a sprint across a long weekend — the Business Days Calculator handles the same inclusive counting in your browser without sending dates to a server. It counts weekdays Monday to Friday, reports total calendar days and weekend days alongside the working-day total, and lets you paste an optional comma-separated list of YYYY-MM-DD holidays to subtract. The same trick that lets Flow users audit a stored count lets you here audit a formula result: pick the two dates the Flow produced and see whether the browser agrees.
For a deeper look at the same inclusive convention — and how it shows up across other business apps — the business-days-between-two-dates walkthrough lays out the underlying math step by step.
How to Use the Business Days Calculator
The tool is designed to mirror the inclusive behaviour of NETWORKDAYS so the answer matches what your Salesforce formula or Flow should be returning.
- Pick your start date — the calculator defaults to today, so adjust it to the actual period you care about.
- Pick your end date; the business-day count, total days, and weekend days update instantly, with no button to press.
- Optional: paste holidays as comma-separated YYYY-MM-DD dates into the holidays field to subtract them from the working-day total.
Working example. Suppose you set the start date to Monday 3 March 2025 and the end date to Friday 7 March 2025. The inclusive calendar span is five days and it covers exactly one full Monday-to-Friday week, so the calculator reports 5 business days, 5 total days, and 0 weekend days. Add a single holiday that lands inside that range and on a weekday and the business-day total drops by one.
Reading the Numbers the Calculator Reports
Three figures appear alongside the business-day total so you can sanity-check the result without doing the math by hand.
- Business days. The inclusive count of Monday-through-Friday days in your range, with optional holidays subtracted.
- Total days. The full inclusive calendar span from start date to end date.
- Weekend days. The number of Saturdays and Sundays that were removed from the business-day total.
- Holidays excluded. The number of dates in your holidays list that actually fell inside the range on a weekday and were therefore subtracted.
A quick mental check: business days plus weekend days plus holidays excluded should equal total days, provided every listed holiday lands inside the range on a weekday.
Salesforce Approach vs. Calculator: When to Use Each
| Approach | Setup effort | Handles holidays | Stored on record | Best for |
|---|---|---|---|---|
| Formula field | Low | Only via hard-coded list | No (recomputed on read) | Lightweight counts where holidays rarely change |
| Record-Triggered Flow | Medium | Yes, via custom Holiday object | Yes | Production reporting and audit-friendly counts |
| Apex class | High | Yes, with full logic | Optional | Multi-region, batch, or service-layer logic |
| Browser calculator | None | Yes, via optional comma-separated list | No | Quick checks, deadline planning, formula verification |
The pattern to keep in mind is that the underlying math — full weeks times five plus the weekday tail — is the same regardless of which platform performs it. What changes is where the formula lives and how much maintenance it costs you.