# Exclude weekends from date calculation

Options
✭✭✭✭✭

Hello,

Is there a way to exclude weekends from a date calculation? I have an application with start and end dates and I want to calculate the number of days between the start and end date, not counting weekends.

I have this formula working but it includes weekends so if someone takes a Friday and a Monday the calculation shows 4 days instead of 2.

=IF(AND([End Date]@row - [Start Date]@row = 0, [PTO Type]@row = "PTO - Half Day"), 0.5, IF(AND([End Date]@row - [Start Date]@row = 0, [PTO Type]@row <> "PTO - Half Day"), 1, ([End Date]@row - [Start Date]@row) + 1))

Thanks!

Andrea

Andrea Zenner

Program Manager | Infrastructure & Operations

Apogee Enterprises

EAP | Mobilizer | Core Product Certified | Superstar

azenner@apog.com

Tags:

• ✭✭✭✭✭✭
Options

Have you looked into the NETWORKDAY function?

• ✭✭✭✭✭✭
Options

If the start date is a non-working day, then the NETWORKDAY function will add 1. You may want to double check that start date.

• ✭✭✭✭✭✭
Options

Have you looked into the NETWORKDAY function?

• ✭✭✭✭✭
Options

That seems to work! I have one entry for which it's counting 1 weekend day but I'll figure that out.. it is working for the other entries.

Thanks much @Paul Newcome !

Andrea Zenner

Program Manager | Infrastructure & Operations

Apogee Enterprises

EAP | Mobilizer | Core Product Certified | Superstar

azenner@apog.com

• ✭✭✭✭✭✭
Options

If the start date is a non-working day, then the NETWORKDAY function will add 1. You may want to double check that start date.

• ✭✭✭✭✭
Options

@Paul Newcome That was the problem! We'll just instruct people to not enter start dates on a weekend. Thanks again!

Andrea Zenner

Program Manager | Infrastructure & Operations

Apogee Enterprises

EAP | Mobilizer | Core Product Certified | Superstar

azenner@apog.com

• ✭✭✭✭✭✭
Options

Great! Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!