A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

formula to calculate number of hours worked in a day



 
 
Thread Tools Display Modes
  #1  
Old July 2nd 07, 07:44 AM posted to microsoft.public.excel.misc
xololady
external usenet poster
 
Posts: 9
Default formula to calculate number of hours worked in a day

I am trying to put together a time sheet, where I can put my time in and out,
and then give the total hours at the end of the day. For example, I sum (12
pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But my
formula spits out a sub zero number. Do I need to divide these by 24?
Ads
  #2  
Old July 2nd 07, 08:08 AM posted to microsoft.public.excel.misc
Toppers
external usenet poster
 
Posts: 4,340
Default formula to calculate number of hours worked in a day

Format cells as hh:mm and Total cell as [h]:mm: the latter will stop Excel
subtracting 24 from the total if it is >24

Start time in A1 and Finish Time in B1

in C1: =MOD(B1-A1,1)

This will allow for times running over midnight

If this doesn't ever happen then =(B1-A1) will suffice

Assuming times are in rows 1 to 7 , then in C8: =SUM(C1:C7)

C8 formatted as [h]:mm

HTH


"xololady" wrote:

> I am trying to put together a time sheet, where I can put my time in and out,
> and then give the total hours at the end of the day. For example, I sum (12
> pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But my
> formula spits out a sub zero number. Do I need to divide these by 24?

  #3  
Old July 2nd 07, 08:16 AM posted to microsoft.public.excel.misc
xololady
external usenet poster
 
Posts: 9
Default formula to calculate number of hours worked in a day

Thank you! That worked! I thought my formula made sense, but it didn't
work.

"Toppers" wrote:

> Format cells as hh:mm and Total cell as [h]:mm: the latter will stop Excel
> subtracting 24 from the total if it is >24
>
> Start time in A1 and Finish Time in B1
>
> in C1: =MOD(B1-A1,1)
>
> This will allow for times running over midnight
>
> If this doesn't ever happen then =(B1-A1) will suffice
>
> Assuming times are in rows 1 to 7 , then in C8: =SUM(C1:C7)
>
> C8 formatted as [h]:mm
>
> HTH
>
>
> "xololady" wrote:
>
> > I am trying to put together a time sheet, where I can put my time in and out,
> > and then give the total hours at the end of the day. For example, I sum (12
> > pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But my
> > formula spits out a sub zero number. Do I need to divide these by 24?

  #4  
Old July 2nd 07, 08:17 AM posted to microsoft.public.excel.misc
David Biddulph[_2_]
external usenet poster
 
Posts: 8,651
Default formula to calculate number of hours worked in a day

If you want to get decimal hours, rather than Excel time format, divide by
24 and format as General or Number.

But the answer is 8 hours, not a sub-zero number. You may need to check
that all your data are times, not text. Temporarily format the four input
cells as number, rather than time, and then you should see them all change
to decimals of a day. If they don't all change to decimals of a day, there
may be spare spaces or non-printing characters which are keeping them as
text.
--
David Biddulph

"xololady" > wrote in message
news
>I am trying to put together a time sheet, where I can put my time in and
>out,
> and then give the total hours at the end of the day. For example, I sum
> (12
> pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But
> my
> formula spits out a sub zero number. Do I need to divide these by 24?



  #5  
Old July 2nd 07, 08:20 AM posted to microsoft.public.excel.misc
xololady
external usenet poster
 
Posts: 9
Default formula to calculate number of hours worked in a day

OK< Next question. When I total the hours at the bottom, I want to take that
total and multiply by an hourly wage, such as $8. I got 10 hours for a sum,
but when I multiplied it by 8, I got $3.33.


"xololady" wrote:

> Thank you! That worked! I thought my formula made sense, but it didn't
> work.
>
> "Toppers" wrote:
>
> > Format cells as hh:mm and Total cell as [h]:mm: the latter will stop Excel
> > subtracting 24 from the total if it is >24
> >
> > Start time in A1 and Finish Time in B1
> >
> > in C1: =MOD(B1-A1,1)
> >
> > This will allow for times running over midnight
> >
> > If this doesn't ever happen then =(B1-A1) will suffice
> >
> > Assuming times are in rows 1 to 7 , then in C8: =SUM(C1:C7)
> >
> > C8 formatted as [h]:mm
> >
> > HTH
> >
> >
> > "xololady" wrote:
> >
> > > I am trying to put together a time sheet, where I can put my time in and out,
> > > and then give the total hours at the end of the day. For example, I sum (12
> > > pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But my
> > > formula spits out a sub zero number. Do I need to divide these by 24?

  #6  
Old July 2nd 07, 08:32 AM posted to microsoft.public.excel.misc
xololady
external usenet poster
 
Posts: 9
Default formula to calculate number of hours worked in a day

I got the hours to do what I want. Now I am trying to calculate wages
earned. So I add the total hours by $8. I got 10 hours times $8 and it gave
me $3.33. The hours are formated as time and the total hours is formated as
time. I calculated the pay cell cell as currency.

"David Biddulph" wrote:

> If you want to get decimal hours, rather than Excel time format, divide by
> 24 and format as General or Number.
>
> But the answer is 8 hours, not a sub-zero number. You may need to check
> that all your data are times, not text. Temporarily format the four input
> cells as number, rather than time, and then you should see them all change
> to decimals of a day. If they don't all change to decimals of a day, there
> may be spare spaces or non-printing characters which are keeping them as
> text.
> --
> David Biddulph
>
> "xololady" > wrote in message
> news
> >I am trying to put together a time sheet, where I can put my time in and
> >out,
> > and then give the total hours at the end of the day. For example, I sum
> > (12
> > pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But
> > my
> > formula spits out a sub zero number. Do I need to divide these by 24?

>
>
>

  #7  
Old July 2nd 07, 08:37 AM posted to microsoft.public.excel.misc
David Biddulph[_2_]
external usenet poster
 
Posts: 8,651
Default formula to calculate number of hours worked in a day

If you want to convert Excel times (which are counted in days) into hours,
then you need to multiply by 24. Your 10 hours, if still an Excel time, is
stored as 10/24, so when you multiply by 8 you get 3.33.
--
David Biddulph

"xololady" > wrote in message
...
> OK< Next question. When I total the hours at the bottom, I want to take
> that
> total and multiply by an hourly wage, such as $8. I got 10 hours for a
> sum,
> but when I multiplied it by 8, I got $3.33.


> "xololady" wrote:
>
>> Thank you! That worked! I thought my formula made sense, but it didn't
>> work.


>> "Toppers" wrote:
>>
>> > Format cells as hh:mm and Total cell as [h]:mm: the latter will stop
>> > Excel
>> > subtracting 24 from the total if it is >24
>> >
>> > Start time in A1 and Finish Time in B1
>> >
>> > in C1: =MOD(B1-A1,1)
>> >
>> > This will allow for times running over midnight
>> >
>> > If this doesn't ever happen then =(B1-A1) will suffice
>> >
>> > Assuming times are in rows 1 to 7 , then in C8: =SUM(C1:C7)
>> >
>> > C8 formatted as [h]:mm


>> > "xololady" wrote:
>> >
>> > > I am trying to put together a time sheet, where I can put my time in
>> > > and out,
>> > > and then give the total hours at the end of the day. For example, I
>> > > sum (12
>> > > pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time.
>> > > But my
>> > > formula spits out a sub zero number. Do I need to divide these by
>> > > 24?



  #8  
Old July 2nd 07, 09:34 AM posted to microsoft.public.excel.misc
Toppers
external usenet poster
 
Posts: 4,340
Default formula to calculate number of hours worked in a day

If total hours in C8 (as per my posting), then in D8:

=C8*24*8 and format as NUMBER (or Currency)

If you want total hours to be decimal number:

in C8: =SUM(C1:C7)*24 and format as NUMBER

in D8: =C8*8


(As per David's replies)

HTH

"xololady" wrote:

> I got the hours to do what I want. Now I am trying to calculate wages
> earned. So I add the total hours by $8. I got 10 hours times $8 and it gave
> me $3.33. The hours are formated as time and the total hours is formated as
> time. I calculated the pay cell cell as currency.
>
> "David Biddulph" wrote:
>
> > If you want to get decimal hours, rather than Excel time format, divide by
> > 24 and format as General or Number.
> >
> > But the answer is 8 hours, not a sub-zero number. You may need to check
> > that all your data are times, not text. Temporarily format the four input
> > cells as number, rather than time, and then you should see them all change
> > to decimals of a day. If they don't all change to decimals of a day, there
> > may be spare spaces or non-printing characters which are keeping them as
> > text.
> > --
> > David Biddulph
> >
> > "xololady" > wrote in message
> > news
> > >I am trying to put together a time sheet, where I can put my time in and
> > >out,
> > > and then give the total hours at the end of the day. For example, I sum
> > > (12
> > > pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time. But
> > > my
> > > formula spits out a sub zero number. Do I need to divide these by 24?

> >
> >
> >

  #9  
Old July 2nd 07, 11:22 AM posted to microsoft.public.excel.misc
David Biddulph[_2_]
external usenet poster
 
Posts: 8,651
Default formula to calculate number of hours worked in a day

I was, of course, asleep when I said DIVIDE by 24. I should have said
MULTIPLY by 24.
--
David Biddulph

"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
...
> If you want to get decimal hours, rather than Excel time format, divide by
> 24 and format as General or Number.
>
> But the answer is 8 hours, not a sub-zero number. You may need to check
> that all your data are times, not text. Temporarily format the four input
> cells as number, rather than time, and then you should see them all change
> to decimals of a day. If they don't all change to decimals of a day,
> there may be spare spaces or non-printing characters which are keeping
> them as text.
> --
> David Biddulph
>
> "xololady" > wrote in message
> news
>>I am trying to put together a time sheet, where I can put my time in and
>>out,
>> and then give the total hours at the end of the day. For example, I sum
>> (12
>> pm -8 am) + (5 pm -1 pm). I have formatted these cells to show time.
>> But my
>> formula spits out a sub zero number. Do I need to divide these by 24?

>
>



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
wages - multiply hours and minutes by number of hours worked Carol (Australia) Excel Discussion (Misc queries) 6 April 1st 07 01:16 AM
Drivers Hours Timesheet - Calculate Hours Worked on Weekly Basis Graham Excel Discussion (Misc queries) 2 January 28th 07 08:40 PM
Calculate hours worked larry_saudi New Users to Excel 5 October 11th 06 07:46 PM
Need formula to calculate hours worked BankC Excel Discussion (Misc queries) 12 January 31st 06 05:38 PM
CALCULATE HOURS WORKED Calculation of hours worked. Excel Discussion (Misc queries) 3 January 20th 05 06:01 PM


All times are GMT +1. The time now is 11:18 PM.


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