Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mohammed Zenuwah
 
Posts: n/a
Default Calculating working hours

Hi All,

I'm hoping someone can help me with the following problem.

I need to create a formula which calculates the different between two
date/time values excluding out of business hours.

Here's an example.
A1: 21/06/2005 10:00:00
A2: 23/06/2005 14:30:00

When using "=(B1-A1)*24" I can the result 52.5
If the business hours are between 08:30 and 17:00 the actual result required
is 21.5

I hope this makes sense.

Thanks in advance,

Mo..
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Try this

=(INT(A2)-INT(A1))*8.5+(MOD(A2,1)-MOD(A1,1))*24

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi All,

I'm hoping someone can help me with the following problem.

I need to create a formula which calculates the different between two
date/time values excluding out of business hours.

Here's an example.
A1: 21/06/2005 10:00:00
A2: 23/06/2005 14:30:00

When using "=(B1-A1)*24" I can the result 52.5
If the business hours are between 08:30 and 17:00 the actual result

required
is 21.5

I hope this makes sense.

Thanks in advance,

Mo..



  #3   Report Post  
Mohammed Zenuwah
 
Posts: n/a
Default

Hi Bob,

Thanks for this, it worked a treat, I've justed realised I'll need to
exclude weekends, how would I implement this using networkdays?

Thanks in advance,

Mo..

"Bob Phillips" wrote:

Try this

=(INT(A2)-INT(A1))*8.5+(MOD(A2,1)-MOD(A1,1))*24

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi All,

I'm hoping someone can help me with the following problem.

I need to create a formula which calculates the different between two
date/time values excluding out of business hours.

Here's an example.
A1: 21/06/2005 10:00:00
A2: 23/06/2005 14:30:00

When using "=(B1-A1)*24" I can the result 52.5
If the business hours are between 08:30 and 17:00 the actual result

required
is 21.5

I hope this makes sense.

Thanks in advance,

Mo..




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

=(NETWORKDAYS(A1,A2)-1)*8.5+(MOD(A2,1)-MOD(A1,1))*24

or

=(NETWORKDAYS(A1,A2, holidays)-1)*8.5+(MOD(A2,1)-MOD(A1,1))*24


if you want to exclude holidays

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi Bob,

Thanks for this, it worked a treat, I've justed realised I'll need to
exclude weekends, how would I implement this using networkdays?

Thanks in advance,

Mo..

"Bob Phillips" wrote:

Try this

=(INT(A2)-INT(A1))*8.5+(MOD(A2,1)-MOD(A1,1))*24

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi All,

I'm hoping someone can help me with the following problem.

I need to create a formula which calculates the different between two
date/time values excluding out of business hours.

Here's an example.
A1: 21/06/2005 10:00:00
A2: 23/06/2005 14:30:00

When using "=(B1-A1)*24" I can the result 52.5
If the business hours are between 08:30 and 17:00 the actual result

required
is 21.5

I hope this makes sense.

Thanks in advance,

Mo..






  #5   Report Post  
Mohammed Zenuwah
 
Posts: n/a
Default

Hi Bob,

thanks loads, both of them worked a treat.

Thanks again,

Mo..

"Bob Phillips" wrote:

=(NETWORKDAYS(A1,A2)-1)*8.5+(MOD(A2,1)-MOD(A1,1))*24

or

=(NETWORKDAYS(A1,A2, holidays)-1)*8.5+(MOD(A2,1)-MOD(A1,1))*24


if you want to exclude holidays

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi Bob,

Thanks for this, it worked a treat, I've justed realised I'll need to
exclude weekends, how would I implement this using networkdays?

Thanks in advance,

Mo..

"Bob Phillips" wrote:

Try this

=(INT(A2)-INT(A1))*8.5+(MOD(A2,1)-MOD(A1,1))*24

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi All,

I'm hoping someone can help me with the following problem.

I need to create a formula which calculates the different between two
date/time values excluding out of business hours.

Here's an example.
A1: 21/06/2005 10:00:00
A2: 23/06/2005 14:30:00

When using "=(B1-A1)*24" I can the result 52.5
If the business hours are between 08:30 and 17:00 the actual result
required
is 21.5

I hope this makes sense.

Thanks in advance,

Mo..








  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

Pleasure Mo.

"Mohammed Zenuwah" wrote in
message ...
Hi Bob,

thanks loads, both of them worked a treat.

Thanks again,

Mo..

"Bob Phillips" wrote:

=(NETWORKDAYS(A1,A2)-1)*8.5+(MOD(A2,1)-MOD(A1,1))*24

or

=(NETWORKDAYS(A1,A2, holidays)-1)*8.5+(MOD(A2,1)-MOD(A1,1))*24


if you want to exclude holidays

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote in
message ...
Hi Bob,

Thanks for this, it worked a treat, I've justed realised I'll need to
exclude weekends, how would I implement this using networkdays?

Thanks in advance,

Mo..

"Bob Phillips" wrote:

Try this

=(INT(A2)-INT(A1))*8.5+(MOD(A2,1)-MOD(A1,1))*24

--
HTH

Bob Phillips

"Mohammed Zenuwah" wrote

in
message ...
Hi All,

I'm hoping someone can help me with the following problem.

I need to create a formula which calculates the different between

two
date/time values excluding out of business hours.

Here's an example.
A1: 21/06/2005 10:00:00
A2: 23/06/2005 14:30:00

When using "=(B1-A1)*24" I can the result 52.5
If the business hours are between 08:30 and 17:00 the actual

result
required
is 21.5

I hope this makes sense.

Thanks in advance,

Mo..








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
calculating hours bus2408 Excel Worksheet Functions 2 June 23rd 05 02:39 PM
Calculating Overtime from Hours total Dreamweavn via OfficeKB.com Excel Worksheet Functions 6 April 29th 05 11:21 PM
Calculating working hours Sarah Excel Discussion (Misc queries) 3 March 13th 05 11:42 PM
need help w/formula for calculating overtime hours jv749297 Excel Worksheet Functions 1 January 17th 05 07:54 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM


All times are GMT +1. The time now is 09:50 PM.

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

About Us

"It's about Microsoft Excel"