Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 81
Default Work hours calculation

Hi everyone,
I have a problem with calculating work hours. I use the normal simple
formula Ex:
=(B1-A1)*24 Assuming that 'A1' is the in time and 'B1' is the out time.
This works OK, but if the in time is before midnight and the out time is
after midnight it does not work. I managed to get the answer right by adding
24 to the formula but then it will not work properly for time before midnight.
I appreciate your help and thank you.

Albert - Malta
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Work hours calculation

Assuming A1,B1 are in hh:mm format:

=MOD(B1-A1,1)

"albertmb" wrote:

Hi everyone,
I have a problem with calculating work hours. I use the normal simple
formula Ex:
=(B1-A1)*24 Assuming that 'A1' is the in time and 'B1' is the out time.
This works OK, but if the in time is before midnight and the out time is
after midnight it does not work. I managed to get the answer right by adding
24 to the formula but then it will not work properly for time before midnight.
I appreciate your help and thank you.

Albert - Malta

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Work hours calculation

Either use Toopers' suggestion and multiply by 24, i.e.

=MOD(B1-A1,1)*24

or

=(B1-A1+(A1B1))*24

"albertmb" wrote:

Hi everyone,
I have a problem with calculating work hours. I use the normal simple
formula Ex:
=(B1-A1)*24 Assuming that 'A1' is the in time and 'B1' is the out time.
This works OK, but if the in time is before midnight and the out time is
after midnight it does not work. I managed to get the answer right by adding
24 to the formula but then it will not work properly for time before midnight.
I appreciate your help and thank you.

Albert - Malta

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 81
Default Work hours calculation

Thank you Toppers and Daddylonglegs, formula worked perfectly.

All the Best
Albert

"Toppers" wrote:

Assuming A1,B1 are in hh:mm format:

=MOD(B1-A1,1)

"albertmb" wrote:

Hi everyone,
I have a problem with calculating work hours. I use the normal simple
formula Ex:
=(B1-A1)*24 Assuming that 'A1' is the in time and 'B1' is the out time.
This works OK, but if the in time is before midnight and the out time is
after midnight it does not work. I managed to get the answer right by adding
24 to the formula but then it will not work properly for time before midnight.
I appreciate your help and thank you.

Albert - Malta

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
Hours calculation in 24h format LMC Excel Discussion (Misc queries) 10 January 19th 07 11:30 AM
Schedule hours calculation RJ Swain Excel Discussion (Misc queries) 6 November 21st 06 09:32 PM
HOURS CALCULATION Stuart Carnachan Excel Discussion (Misc queries) 2 October 31st 06 04:26 PM
Removing non Work Hours from Excel calculation [email protected] Excel Worksheet Functions 23 March 11th 06 01:31 AM
Calculation of full hours [email protected] Excel Worksheet Functions 1 September 8th 05 06:26 PM


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