Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
pol pol is offline
external usenet poster
 
Posts: 129
Default to find diffrence in time

Hi all,

Please anybody can help me to write a general function that can be used in
excel as well as outside excel. I have the following information

opening time closing time breake Effective hrs
9.00 17.30 1.40 ?
8.30 16.40 1.50 ?
7.40 17.50 2.45 ?

I want to write a function to find effective hours. Pls help

With thanks

Polachan




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default to find diffrence in time

Hi,

I have no idea what you mean by a formula that will work outside Excel but
this will work in Excel

=((B1-A1)-C1)*24

Mike

"pol" wrote:

Hi all,

Please anybody can help me to write a general function that can be used in
excel as well as outside excel. I have the following information

opening time closing time breake Effective hrs
9.00 17.30 1.40 ?
8.30 16.40 1.50 ?
7.40 17.50 2.45 ?

I want to write a function to find effective hours. Pls help

With thanks

Polachan




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default to find diffrence in time

On Dec 8, 9:06*pm, pol wrote:
Hi all,

Please anybody can help me to write a general function that can be used in
excel as well as outside excel. I have the following information

opening time * * * * closing time * *breake * * * * Effective hrs
9.00 * * * * * * * * * * *17.30 * * * * * *1.40 * * * * * *?
8.30 * * * * * * * * * * *16.40 * * * * * *1.50 * * * * * *?
7.40 * * * * * * * * * * *17.50 * * * * * *2.45 * * * * * *?

I want to write a function to find effective hours. Pls help

With thanks

Polachan


Pol,

First ..... background:
Excel stores dates as the number of days from either jan 1 1904 or jan
1 1900, depending on setup. Assume you, like most people are using the
1900 setup. 1/1/1900 is day 1, 2/1/190 is day 2, 1/1/1901is day 366
and so on. These day values are called date serials.
Times are stored as a fraction of a day, i.e noon is .5, 6pm is .75
8am is, .333333. so 0900 is .375. To enter times, use the ":"
separator, and Excel will automatically recognise the entry as a time
value.

This makes date/time calculations really easy, with one drawback a
date/time value can never be negative.

Assume your data is columns A, B and C, with the formula in D, first
data row at row 2.
Cell D2 contains the formula "=B2-A2-C2" and displays the result
"6:50" (remember to use the : separator.
Copy down.

This will only work if the times don't go over midnight. If that is
the case, you need to use a slightly more complicated version, and
incorporate the IF function.

try "=If( A2B2, 1+B2-A2-C2, B2-A2-C2)"

the if function has three parts:
Logical Test (in this case A2B2) - the Logical test must evaluate to
either true or false
Value if true (1+B2-A2-C2) - this is the formula for when the logical
test = true
Value if false (the rest) - when logical test = false

Each part is separated by the ","

In this If function if A2 is greater than B2 (start is after finish)
then we add one to the formula to calculate the time.

Assume start 21:00, finish 03:00, elapsed time 6:00, however Excel
would calculate this as .125 (B2) - .875 (A2) and end up with
negative .75 BUT Excel cannot recognise the negative time, and
therefore produces an error message.
By adding 1 to the formula, we effectively make the calculation 1.125-.
875 result .25 displayed as "6:00"

HTH

Steve


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default to find diffrence in time

Hi Pol
If you use a colon separator for standard time notation (ex. 9:00) rather
than a decimal point (9.00) the following will give you a result in a HH:MM
format:
=B1-A1-C1
With cell A containing the start time, B the finish time and C the break time.
Start Finish Break Hours
9:00 17:30 1:40 6:50
Note: If the start time is before midnight and the finish time is after,
14:00 to 1:00 (AM), the finish time must be entered as-in the example-25:00.

Mike's formula results in a decimal number for easy calculation when
multiplied by hourly compensation, but you still need to use the colon format
(9:00) to make it work.

"Mike H" wrote:

Hi,

I have no idea what you mean by a formula that will work outside Excel but
this will work in Excel

=((B1-A1)-C1)*24

Mike

"pol" wrote:

Hi all,

Please anybody can help me to write a general function that can be used in
excel as well as outside excel. I have the following information

opening time closing time breake Effective hrs
9.00 17.30 1.40 ?
8.30 16.40 1.50 ?
7.40 17.50 2.45 ?

I want to write a function to find effective hours. Pls help

With thanks

Polachan




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
calculate the diffrence in cost Calculate difference in price Excel Worksheet Functions 3 October 18th 09 06:24 PM
calculate the the diffrence between 2 Dates and time LKWP Excel Worksheet Functions 2 July 2nd 08 02:15 PM
time diffrence with 24 hour clock Rich Mcc Excel Worksheet Functions 3 October 25th 06 03:39 PM
Cells with time format and calculating the diffrence MikeR-Oz New Users to Excel 11 January 3rd 06 10:11 AM
.01 or .02 diffrence in computation Dr.How via OfficeKB.com Excel Discussion (Misc queries) 1 September 30th 05 12:29 PM


All times are GMT +1. The time now is 05:59 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"