MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Removing weekend dates for a formula that calculates the number of days between 2 dates

Posted by gavin on May 08, 2001 3:03 AM


Can anyone please help me.

I have a formula which calculates if an order was received b4 15.00hrs whether it was shipped the next day and also if not whether it was shipped the following day from that!! ( Its used for SLA calculations)

Formulas as follows:

(Shipped next day for orders received b4 15.00hrs, formula gives me a 1 if ok.)


(shipped within 2 days of receipt, again gives a 1 if ok)


Currently it includes weekends, so does anyone know how to exclude them!

Many Thanks for all that have read this message this far!


Posted by JAF on May 08, 2001 3:28 AM


I'm not clear from your formulas which cells contain the dates, but the function you need is NETWORKDAYS.

Rather than simply specifying EndDate - StartDate, if you use =NETWORKDAYS(StartDate,EndDate), this will exclude weekends.

You can also specify public holiday dates to be excluded as well.

The online help for NETWORKDAYS should give you any pointers if the above is not clear.


Posted by Gavin on May 08, 2001 4:33 AM


Thank you very much for the advice, much appreciated



Posted by Aladin Akyurek on May 08, 2001 5:57 AM


It seems to me that you could use NEETWORKDAYS (activate Analysis Toolpak via Tools|Add ins, if you don't have it).

Assuming that

A2 contains date order received
C2 contains hour order received
B2 contains date of shipment


This gives you number of days between receipt and shipment involving orders received before 1500.

You can then categorize the result of this formula any way you wish.

Note. NETWORKDAYS enables you to exclude holidays too.

Hope this helps.


Posted by Aladin Akyurek on May 08, 2001 6:03 AM



I see you already said what is needed. I had the response ready but had no time to submit -- just run to give a 2 hours class. Back from the class, I simply hit submit, hence the duplication.