Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default calculating hours work has taken

Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This is
end of work.
In E1 I would like to calculate the total hours worked giving the answer in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default calculating hours work has taken

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default calculating hours work has taken

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to 16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any given
day. Therefore it would be correct to say if the job took at total of 8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5 minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default calculating hours work has taken

On Sun, 20 Apr 2008 02:26:00 -0700, Marty
wrote:

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to 16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any given
day. Therefore it would be correct to say if the job took at total of 8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5 minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





Still not enough information given.
If we don't know when the lunch is, we can't tell e.g. if a work
started 10:30 and ended 12:30 took 1 hour (if lunch is 11-12) or 2
hours (if lunch is 13-14)

Lars-Åke

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default calculating hours work has taken

Lunch is between 12 and 1 Monday to Friday.
No work on Saturday and Sunday.
(wish I had a job that worked those hours :)

"Lars-Ã…ke Aspelin" wrote:

On Sun, 20 Apr 2008 02:26:00 -0700, Marty
wrote:

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to 16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any given
day. Therefore it would be correct to say if the job took at total of 8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5 minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





Still not enough information given.
If we don't know when the lunch is, we can't tell e.g. if a work
started 10:30 and ended 12:30 took 1 hour (if lunch is 11-12) or 2
hours (if lunch is 13-14)

Lars-Ã…ke




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default calculating hours work has taken

On Sun, 20 Apr 2008 04:34:01 -0700, Marty
wrote:

Lunch is between 12 and 1 Monday to Friday.
No work on Saturday and Sunday.
(wish I had a job that worked those hours :)

"Lars-Åke Aspelin" wrote:

On Sun, 20 Apr 2008 02:26:00 -0700, Marty
wrote:

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to 16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any given
day. Therefore it would be correct to say if the job took at total of 8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5 minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





Still not enough information given.
If we don't know when the lunch is, we can't tell e.g. if a work
started 10:30 and ended 12:30 took 1 hour (if lunch is 11-12) or 2
hours (if lunch is 13-14)

Lars-Åke



Try this:
(Start time is in cell A1 and end time in cell A2.)

=DAY(A2)-DAY(A1)-2*(INT((DAY(A2)-DAY(A1))/7)+(WEEKDAY(A2)<
WEEKDAY(A1)))-(MOD(A2,1)<MOD(A1,1)) & " days and " & (TEXT(
IF(MOD(A2,1)=MOD(A1,1),MOD(A2,1)-MOD(A1,1),8.5/24+(MOD(A2,1)-
MOD(A1,1)))-1/24*(OR(AND(MOD(A1,1)<0.5,MOD(A2,1)0.5),AND(MOD(A2 ,1)<
MOD(A1,1),OR(MOD(A1,1)<=0.5,MOD(A2,1)0.5)))), "h:mm"))& " hours:mins"

This formula is made under the assumption that no start or end of work
can take place during lunch hour or outside working hours, and that
the work starts before it ends :-)

This is how it works:

The first part calculates the difference in day by subtracting 2 days
for each complete week. Also subtrackt 2 days if the end date is on an
earlier weekday than the starting date. Finally subtract one day if
the end time is earlier on the end day than the starting time on the
start day. This give the number of (whole) days.

The second part calculates the additional hours by subtracting the
start time within the start day from the end time within the end day.
Add 8.5 hours to get a positive value if the end time is earlier than
the start time.
Finally subtract 1 hour, i.e. 1/24 days if there is a lunch break in
the interval. That happens either if the start time is before noon
(0.5) and the end time if after noon or if the start time is after
the end time and either the start time is before noon or the end time
is after noon.

Lars-Åke
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default calculating hours work has taken

Note that using this method the days will roll over after 31 and there's no
way to stop it. [d] doesn't work.

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default calculating hours work has taken

Sort of works. However I entered a start time of 08:00 and a end time of
20:00. Minus the 1 hour lunch it returned a value of 11 hours. normally this
would be correct however the working day is only 7:30 long. The answer I was
hoping for is 1 day and 3 hours and 30 minutes

"Lars-Ã…ke Aspelin" wrote:

On Sun, 20 Apr 2008 02:26:00 -0700, Marty
wrote:

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to 16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any given
day. Therefore it would be correct to say if the job took at total of 8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5 minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





Still not enough information given.
If we don't know when the lunch is, we can't tell e.g. if a work
started 10:30 and ended 12:30 took 1 hour (if lunch is 11-12) or 2
hours (if lunch is 13-14)

Lars-Ã…ke


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default calculating hours work has taken

Your last post raises a question... if you can have more than 7.5 hours
worked in a single day, how would we know how many hours to assign per day
for a multi-day span like you gave us in your first posting? For example, in
your first posting, you said...

C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00.
This is commencement of work.

D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00.
This is end of work.

How do we know an 11-hour day (like the one you just proposed in your last
posting) was not worked on, say, the 17th?

Rick


"Marty" wrote in message
...
Sort of works. However I entered a start time of 08:00 and a end time of
20:00. Minus the 1 hour lunch it returned a value of 11 hours. normally
this
would be correct however the working day is only 7:30 long. The answer I
was
hoping for is 1 day and 3 hours and 30 minutes

"Lars-Ã…ke Aspelin" wrote:

On Sun, 20 Apr 2008 02:26:00 -0700, Marty
wrote:

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to
16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any
given
day. Therefore it would be correct to say if the job took at total of
8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5
minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure
what
answer you are looking for (it would have helped if you told us the
answer
you expected for the example you gave). I'll go with what I think is
the
obvious (length of the day is immaterial... from the 15th to the 18th
is 3
days, period, and the number of hours is difference from an assumed
start
time of 8:00am to the given end time, assumed to be no more than 7.5).
If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for
example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00.
This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00.
This
is
end of work.
In E1 I would like to calculate the total hours worked giving the
answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





Still not enough information given.
If we don't know when the lunch is, we can't tell e.g. if a work
started 10:30 and ended 12:30 took 1 hour (if lunch is 11-12) or 2
hours (if lunch is 13-14)

Lars-Ã…ke



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default calculating hours work has taken

On Mon, 21 Apr 2008 00:35:01 -0700, Marty
wrote:

Sort of works. However I entered a start time of 08:00 and a end time of
20:00. Minus the 1 hour lunch it returned a value of 11 hours. normally this
would be correct however the working day is only 7:30 long. The answer I was
hoping for is 1 day and 3 hours and 30 minutes

"Lars-Åke Aspelin" wrote:

On Sun, 20 Apr 2008 02:26:00 -0700, Marty
wrote:

Thanks Rick

Would it help if I mentioned the working hours of a day are 07:30 to 16:00,
minus 1:00 lunch is a total of 7:30 that is possible to work in any given
day. Therefore it would be correct to say if the job took at total of 8:35 to
complete then the answer I was looking for is 1 day, 1 hour and 5 minutes.

Many thanks

"Rick Rothstein (MVP - VB)" wrote:

Because you mentioned the length of the day, I'm not completely sure what
answer you are looking for (it would have helped if you told us the answer
you expected for the example you gave). I'll go with what I think is the
obvious (length of the day is immaterial... from the 15th to the 18th is 3
days, period, and the number of hours is difference from an assumed start
time of 8:00am to the given end time, assumed to be no more than 7.5). If
that is the case, then try this formula...

=TEXT(D1-C1,"d ""days"" h ""hours""")

If you wanted something else, or more (account for overtime for example),
then give us some more details.

Rick


"Marty" wrote in message
...
Using the following;
C1 is formatted in dd/mm/yyyyy h:mm entered value is 15/4/2008 8:00. This
is
commencement of work.
D1 is formatted in dd/mm/yyy h:mm entered value is 18/4/2008 10:00. This
is
end of work.
In E1 I would like to calculate the total hours worked giving the answer
in
days and hours. Note the working day is 7 hours 30 min long.
Thanks in advance





Still not enough information given.
If we don't know when the lunch is, we can't tell e.g. if a work
started 10:30 and ended 12:30 took 1 hour (if lunch is 11-12) or 2
hours (if lunch is 13-14)

Lars-Åke




How can you have an end time of 20:00 if working hours end at 16:00 as
you mentioned in an earlier post???

Lars-Åke
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 Nick New Users to Excel 1 March 25th 08 01:52 PM
Calculating hours Kelly_Durden via OfficeKB.com Excel Discussion (Misc queries) 2 January 30th 08 04:47 PM
Calculating hours Pagina-eind hyperlink probleem Excel Discussion (Misc queries) 3 October 18th 07 01:57 PM
Calculating hours Ian[_3_] Excel Worksheet Functions 8 September 19th 07 11:51 AM
Calculating total work week hours Harley mom Excel Worksheet Functions 2 December 20th 05 05:41 PM


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