Difference Between 2 Dates, Incl Weekends, With Variable Work Days

Jul 11, 2006

I am creating a problem report spreadsheet for work. In col C I have a date/time that the problem started, eg, 23-Jun-2006 15:20 and in col D I have a date/time for when the problem was resolved, eg, 26-Jun-2006 15:40. I need to calculate the amount of hours that we were not available for use (due to the problem). This is based on a list of available hours. Eg, on Mondays we are available 19.5 hrs, T-F 22.5 hrs, Sa 14.5 hrs, and Sun 0 hrs.

If I do a straight subtraction, it uses 24 hrs for each day - not taking into account our available hrs. If I do NETWORKDAYS it automatically doesn't consider Sat or Sun - and i need it to - and it does have a DayEnd and DayStart but it assumes they are constants. I found the day corresponding to the date and thought I could determine the series of days between it, e.g., if the start day was Friday & the end day Monday, the series in between is Sat & Sun. Then I could do a lookup on all 4 days in a table & add them all together. But I can't figure out how to do this!

I have a date in a cell and need a formula that will calulate the next 4 days excluding weekends and holidays. I have search and found where one can do more complex items but not just a simple formula. I have attached an example.

I wanted to calculate the difference between dates, excluding the weekends. After much thought i used =NETWORKDAYS(A1,B1)+IF(NETWORKDAYS(A1,A1)+ NETWORKDAYS(B1,B1)=2,-SIGN(NETWORKDAYS(A1,B1)),0) that seemed to be working fine. However, I had a problem today with this formula when my start day was saturday (24/05/08) and the last day was monday (26/05/08). What i want is that when i take the difference between these two days, i should get zero as answer as we are not including the weekends in calculation so the start date should ideally be the first weekday which is Monday. However, the formula is giving me 1 as an answer.

This formula works fine if i select 27/05/08 as last date in which case i get 2 as an answer which is right. In gist, what i am looking for is a formula which will give me the difference between two dates and exclude the weekends from the calculation. The last date can't be a weekend, but the start date can. Hence, whenever the start date is a weekend, the formula should take monday as a start day.

how to find the number of days between 2 Dates excluding weekends and holidays using vba. I m using excel 2003. All I know is to figure out todays date using the keyword 'Date'.

Also, this is my second post and I have tried to comply with the rules regarding the title, but if it is still inappropriate and does not meet 'stating the problem' criteria,

I am looking for formula to calculate the dates between two days (excluding the weekends) I am working in Saudi Arabia and the weekend days over here are thursday and Friday.

I am trying to compile a count of dates using a numerical reference which adds x consecutive dates onto the initial start date based on the number in a cell.The dates added cannot fall on a weekend.

The start date for each calculation begins in D4 with the corresponding number of days to add onto this date in K4. In the example below 8/11/2007 -- 2 means that the 8th and 9th of Nov get one added to their count. As the next row also has 9th Nov as a start date one more is added to 9th Nov. As the 10th and 11th were a weekend they are skipped and the count starts again from the next Monday. I have enclosed a simplified worksheet with some sample data.

I am attempting to get the formula in Column "E" (see attached excel file) to work based off the individual reps 'days off / holidays' (Columns K:P (or more as needed) that they might have. the formula I am using (which works fine) is:

My issue comes up when I am coping this formula for say 100+ rows. When I copy the formula to all of the rows, the (COUNTIF($K$2:$S$2) becomes static and does not realize that the row (ie. Row 26 Rep C) has different days off than Rep A. I can manually change the reference for the countif to specify the correct row to their own days but that becomes tedious very quickly. I was wondering if anyone has come across a way to make the countif work based off of that the name in Column B matches the name in Column G then looks 'to the right' and uses the 'days off' that are listed for the corresponding Rep. I have tried a few different ideas but nothing has worked so far.

I need also to calculate difference between dates(dd-mm-aaaa hh:mm) in workhours ( hh:mm):

The work period is 9-18 with lunch interval 13-14 The startdate and end date could be out of the work hours and i can't include the extra hours. I can have several days (workdays) at the difference, but i should maintain the format hh:mm.

Ex1: Startdate 05-03-2013 18:34 ( date to calculation should be 05-03-2013 18:00) end date 06-03-2013 10:30 Time Difference 1:30 ( from 9 to 10:30 of 06-03-2013 ) will be equal to: Startdate 06-03-2013 8:34 ( date to calculation sould be 06-03-2013 9:00 ) end date 06-03-2013 10:30 Time Difference 1:30 ( from 9 to 10:30 of 06-03-2013 )

Ex2: Startdate 06-03-2013 12:01 End date 06-03-2013 14:28 Time Difference 01:29

I am looking for a formula that will return the number of months (periods) between two dates, ignoring days and years. Using the above dates, which cannot be changed, the result needs to be 63. The formulas I have tried keep returning 64 because my later date is at the end of a period, and my earlier date is at the beginning.

I need to create a spreadsheet that will calculate the difference between two dates and show the result in days. The complicated part is that weekends (Sat and Sun) need to be ignored and any time after 4:30 pm needs to be treated as the next business day. I have been trying to look at similar questions in forum and use the WORKDAYS function with little success.

Example:

A1- 14/08/09 4:40 p.m. B1- 17/08/09 9:10 a.m.

I need the answer (B1-A1) to show up as 0. But if the time in A1 was changed to 4:20 p.m. than the answer should be 1 day.

i have a few fields with dates in my excel sheet. I also have a field, where i want to automatically insert the business day between two other date-fields! Business date means days without the weekend and public holiday! Is it possible to do that? how?

I am creating a 'HelpDesk Issue Logger' and I am trying to calculate the Network Days and Network Hours between two dates with times. I want to know how many business days and hours are between the two days to give me a TURE 'Response Time.'

I have been to several sites and forums looking for the answer, but I have not been able to find a solutions that works for me. Please find attached a 'stripped' down version of my project.

I am trying to find a formula that will return the number of week days between two dates. My specific situation is that my job sets up work orders (WO) to be completed by our staff. We have 3 dates - the date the WO was created, the date the WO is due to be completed, and the date the WO was actually completed.

I would like to subtract the Complete date from the Due date. Generally, this should always equal zero because our staff should be completing WOs on the due date! But obviously that doesn't always happen. There are times that they complete them late, and times they complete them early (yay!).

The problem with NETWORKDAYS is that even when they are completed on time, the result is 1. This formula counts instead of subtracts. I adjusted the formula to =NETWORKDAYS(A3,A4)-1 which works fine for those WOs completed on time or completed late. But for those completed early, it adds (or subtracts, really) 2 days. So for a WO completed a day early, instead of it showing -1, it shows -3. I've attached an example of WOs and the NETWORKDAYS formula I've used so you can see.

Subtract Days.xls

I'm really looking for something that will subtract week days, not count them.

The below formulae allows me to see the difference between two dates and only returns the difference in working hours ie : Difference between 02/02/2010 08:00 & 03/02/2010 08:00 is 16 Hours 0 Minutes

=(INT(A3)-INT(C6))+MAX(MOD(A3,1)-MAX(MOD(C6,1)))

The following displays it in the Hrs and Mins format

what formula I can use to calculate the difference between two dates while not including weekends. For example in cell A1 I have 27-Feb-07 and in B1 I have 05-Mar-07 ; it is possible to to calculate the difference between these by not including weekends. The weekends I am refering to are Saturday and Sunday.

I wanted to determine the number of days between two dates. Specifically, if the initial date is in one month, and the second is in a different month and an output would result a number of days in each month until the final date. BUT I have a large amount of data to do this for in a list view, way to put a formula in excel and just drag down the entire list to get the required information. see below for an example.

The result I'm looking for is the separate the months and only show the relevant months between the two dates in one cell or the adjacent. Something similar to the table outlined below.

I have a holiday and sickness chart for all of the guys in my maintenance department for the whole of next year (2014). The holidays part works fine. The sickness is split into two areas; the number of occurrences of sickness and the total number of days sick. To make the formula work for the number of occurrences it is necessary to enter sick in both Sat and Sun if the sickness spans the weekend. But we do not work the weekend and so I do not want to count those two days. The formula needs to cover the entire year (cells BL5:ZL5). The calculation that I am currently using is =COUNTIF(BL5:ZL5,"Sick")/2 (divided by two as we log a.m. and p.m. and the answer is in days). In the example attached, it would be 1 occurrence of sickness and 3 days sick, not 4 as shown.

For completeness, the formula that I am using for the occurrences is =SUMPRODUCT((BL5:ZL5="Sick")*(BL5:ZL5<>BK5:ZK5))

I am trying to calculate mandays starting from 1st December 2012 to 29th March 2013, and i want to count the days excluding the weekends, formula, i am trying NETWORKDAYS, i use MS2007.

I'm looking for a function similar to =WORKDAY but with a slight variation.

I want the formula to return the date that is the closest non-weekend, non-holiday day that is a specific number of CALENDAR days from the start date. So the formula does not return weekend or holiday days, but does include them when counting the days away from the start date.

For example if the start date was Dec 1st, and I specified 14 days after this date, I would want Dec 15th returned (as the 14th is a weekend).

I am trying to set up a sick leave list which will work out the cumulative total for the last 12 months (from last day of last sick entry). The problem I have, as the is is added to, I need a function/formula to work out 12 months from last date and then add up the no. of sick days from then to the last date. Hope this is clear. The next problem is I need it to work out total days and then without weekends. Below is the chart I have to work out.

Column 1 Start date of sickness column 2 End date Column 3 the number of days sick in period (column 2 less column 1 in days) column 4 the number of days sick in period above excluding week ends (column 2 less column 1, less weekends in days) column 5 total sick days in last 12 months from date in column 2 going back a year including weekends column 6 total sick days in last 12 months from date in column 2 going back a year excluding weekends

What function or formulas can I use to calculate column 3,4,5 & 6. I am a not very experienecd in Excel

I am trying to auto generate a calendar based on two drop down menus - Month and Year.

Once the month and year is selected I want to import all work orders onto the calendar based first on the "Labor Name" found in the list of work tab, then assign each work order for that labor name to the respective date on the calendar for the month.

If I have the start date (say February 01, 2009) and the job will take 100 working days, when will it finish if there is no work done over weekends? I assume you can use networkdays somehow but the final logic escapes me

I attached an excel file for an example. Basically I am calculating on time shipping, but I want don't want Saturday and Sunday to coun't against us.I need G5 to equal 3 days. Right now when I subtract E2 from F2 I get 5 days. But we only work M-F, and Saturday and Sunday shouldn't count against us. How would I subract the days automattically, so it takes out Saturday and Sunday?

Is it possible to make a macro that creates a Pop-up box that asks for date ranges and generates copies of the first worksheet in the workbook labelled as dates? There are ALWAYS 6 half terms to a school year so a 6x2 pop up box / table that is formatted in the following way will allow the appropriate date ranges to be inputted (saturdays and sundays must be excluded from this range):

Title of input box: Input School Half Term Date Ranges

******** Start Date ** End Date ** Autumn 1 03.09.06 18.09.06 Autumn 2 Spring 1 Spring 2 Summer 1 Summer 2

The macro would then create a series of sheets from 03.09.06 to 18.10.06 as well as the other 5 date ranges (excluding weekends) using the first sheet as a template. Would the user have to also input the start day for each half term or would excel 'know that 04.09.06.06 is a Monday and 18.10.06 is a Wednesday?

If the macro could create worksheets for these date ranges and clone the first worksheet in the workbook then that would save me LOADS of time copying and pasting each year.