Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
shadestreet
 
Posts: n/a
Default Subtracting dates to get hours... but I want to skip weekends


In column A I have start times (DD/MM/YY HH/MM/SS) and in column B I
have the stop times. I am measuring the hours from the difference of
these columns for each row, in column C.

However, I would like to exclude weekends from the subtraction. I.e
Friday 5 pm is the start time, Monday 8 am is the stop time, then the
difference would be 15 hours instead of 63 hours.

I know how to convert the fractions returned from the difference, into
hours/minutes/days, and I also know how to convert dates to "day of
week", so unless you guys know of a good idea I was just going to sort
the file by day of week, and start manually deducting 48 hours from the
ones that cross over.

Hoping for an easier way though, 7,000 records and I would like to do
this regularly....

thanks


--
shadestreet
------------------------------------------------------------------------
shadestreet's Profile: http://www.excelforum.com/member.php...fo&userid=7092
View this thread: http://www.excelforum.com/showthread...hreadid=473428

  #2   Report Post  
Gary''s Student
 
Posts: n/a
Default

I assume you have =B1-A1 in C1. If you are not going across a weekend,
WEEKDAY() will increase from A1 to B1. So use:

=IF(WEEKDAY(B1)=WEEKDAY(A1),B1-A1,B1-A1-48)

On my sheet I have to use 2 instead of 48 because my units are days.
--
Gary''s Student


"shadestreet" wrote:


In column A I have start times (DD/MM/YY HH/MM/SS) and in column B I
have the stop times. I am measuring the hours from the difference of
these columns for each row, in column C.

However, I would like to exclude weekends from the subtraction. I.e
Friday 5 pm is the start time, Monday 8 am is the stop time, then the
difference would be 15 hours instead of 63 hours.

I know how to convert the fractions returned from the difference, into
hours/minutes/days, and I also know how to convert dates to "day of
week", so unless you guys know of a good idea I was just going to sort
the file by day of week, and start manually deducting 48 hours from the
ones that cross over.

Hoping for an easier way though, 7,000 records and I would like to do
this regularly....

thanks


--
shadestreet
------------------------------------------------------------------------
shadestreet's Profile: http://www.excelforum.com/member.php...fo&userid=7092
View this thread: http://www.excelforum.com/showthread...hreadid=473428


  #3   Report Post  
shadestreet
 
Posts: n/a
Default


brilliant!

Thanks


--
shadestreet
------------------------------------------------------------------------
shadestreet's Profile: http://www.excelforum.com/member.php...fo&userid=7092
View this thread: http://www.excelforum.com/showthread...hreadid=473428

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I count a rota with no dates and using 24 hours clock APYDS Excel Worksheet Functions 2 September 20th 05 08:40 PM
HOURS DIFFERENCE IN TIME BETWEEN DIFFERENT DATES AND TIMES tankerman Excel Worksheet Functions 1 September 13th 05 04:31 PM
Calculate work hours between two dates trixiebme Excel Worksheet Functions 1 January 12th 05 07:37 PM
Dates Subtracting dates. help me Excel Discussion (Misc queries) 4 December 17th 04 03:48 AM
Subtracting paid hours from unpaid hours ejerry7 Excel Worksheet Functions 5 November 29th 04 04:16 AM


All times are GMT +1. The time now is 08:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"