Time sheets with Numbers program

We use an excel spreadsheet at work for timesheets. First col. time in then Time out in 2nd. Same for 3rd. and 4th. On excel you use SUM and total hours at end. Can not find equation with number that will add up hours. Example:

IN OUT IN OUT
8:00 14:00 14:30 17:00 8:30 hrs.

G4, Mac OS X (10.4.10)

Posted on Aug 10, 2007 4:15 PM

Reply
13 replies

Aug 10, 2007 7:01 PM in response to Earl Neikirk

The best way to do this one is as follows:

Cell A1: 8:00
Cell A2: 14:00
Cell A3: 14:30
Cell A4: 17:00

In result cell, type:
=(-HOUR(A1) 60-MINUTE(A1)HOUR(A2)*60+MINUTE(A2)-HOUR(A3)*60-MINUTE(A3)+HOUR(A4)60MINUTE(A4))/60

The result will be 8.5 ... if you want to display in hours:minutes, then it gets a bit more complicated ... assuming you don't want to waste a cell, type:

=CONCATENATE(ROUNDDOWN((-HOUR(A1) 60-MINUTE(A1)HOUR(A2)*60+MINUTE(A2)-HOUR(A3)*60-MINUTE(A3)+HOUR(A4)*60+MINUTE(A4))/60,0),":", ((-HOUR(A1)*60-MINUTE(A1)+HOUR(A2)*60+MINUTE(A2)-HOUR(A3)*60-MINUTE(A3)+HOUR(A4) *60MINUTE(A4))/60-ROUNDDOWN(B4,0))60)

It works,

the result is 8:30

Aug 12, 2007 3:25 AM in response to Earl Neikirk

May I suggest that you try this in FileMaker (or any other database application). That way you can mantain separate staff and time sheet files but create a relationship between them to record hours worked.
With FileMaker you can also format the result field to display HH:MM:SS or HH:MM or HH. You can also format the input fields to display time as a.m. and p.m or straight 24 hour notation.
You can also create more subtle control over access.
(For those who are interested FileMaker will import from Numbers. But you have to export the numbers file as a CSV first. FileMaker will, on the other hand, open and convert an Excel file directly.)

Aug 12, 2007 7:21 AM in response to crazierthanu

Please excuse my butting-in, but it seemed silly to start a similar thread, so perhaps you can help me?

I have a much simpler timesheet, I just have an in time (A1) and out time (B1) and a total (C1):

In | out | total
9:00 | 12:00 | 3:00

Up until this point I have been manually filling out the in and out and mentally tallying the time and entering it in the total, because I couldn't figure out how to get Excell to do it for me. I now want to do it in numbers and see it is do-able. I tried to apply the one above but wasn't sure what to edit to get it to only tally one in time and one out. If you could help me out that would be great!

A.

Aug 19, 2007 8:32 AM in response to crazierthanu

crazierthanu wrote:
The best way to do this one is as follows:

Cell A1: 8:00
Cell A2: 14:00
Cell A3: 14:30
Cell A4: 17:00

In result cell, type:
=(-HOUR(A1) 60-MINUTE(A1)HOUR(A2)*60+MINUTE(A2)-HOUR(A3)*60-MINUTE(A3)+HOUR(A4)60MINUTE(A4))/60

The result will be 8.5 ... if you want to display in hours:minutes, then it gets a bit more complicated ... assuming you don't want to waste a cell, type:

=CONCATENATE(ROUNDDOWN((-HOUR(A1) 60-MINUTE(A1)HOUR(A2)*60+MINUTE(A2)-HOUR(A3)*60-MINUTE(A3)+HOUR(A4)*60+MINUTE(A4))/60,0),":", ((-HOUR(A1)*60-MINUTE(A1)+HOUR(A2)*60+MINUTE(A2)-HOUR(A3)*60-MINUTE(A3)+HOUR(A4) *60MINUTE(A4))/60-ROUNDDOWN(B4,0))60)

It works,

the result is 8:30



why not just =((a2-a1)+(a4-a3))*24
Worked for me.

Jason

Message was edited by: jaxjason

Sep 4, 2007 11:45 AM in response to crazierthanu

I find it incredible that Apple have released a version of numbers that does not have the ability to do time calculations, If like me you hate Excel and would love to use a more intuitive program this is a massive disappointment

Some of the solutions to this problem that are in this thread may appear to give a solution but on close examination they do not always give the correct answer.

There are four deferent problems hear
1) all time calculations return a decimal integer were 1 is a day and the numbers after the decimal point are the fractions of the day
2) The functions available in Numbers cannot operate on a calculation i.e. MINUTE (C4-B4) extracts the Minutes from C4 only
3) We are dealing with Modulo arithmetic hear i.e 60 minutes plus 1 minute is not 61 minutes but I hour and 1 minute
4) To my mind you need the results of any calculation to return leading 0 were appropriate otherwise the results will look a mess i.e
1:1:1 may be above
10:10:10 not good

1) To solve this you must do all HOUR MINUTE and SECOND extraction on the full result of the calculation not on the remainder
2) You must do the actual calculation in its own cell not as part of the formula
3) This is solved by 1
4) You need an IF statement to insert the leading 0

So if Column C is the start time and D the end time E the calculation D-C then to convert this number back to a string that looks like a time format you need this :
=IF(((E4) 24)<10,"0"&INT((E4)*24),INT((E4)24))&":"&IF((MINUTE(E4))<10,"0"&MINUTE((E4)),MINUTE((E4)))&":"&IF((SECOND(E4))<1 0,"0"&SECOND((E4)),SECOND((E4)))

This cannot deal with negative times If you need to deal with this you will have to identify a negative number i.e. >0 multiply it by -1 and then have a new IF statement to put it back in before the hour result

Apple need to update this program so it can do these calculations simple based on the arguments of the calculation because this result is a string and you cannot there for do further calculations using this result

Sep 4, 2007 12:30 PM in response to Chris Hey

It's not just Apple, Every spreadsheet I have worked with you had to learn the tricks to using the time and date functionality. Excel is a b^%$ to get time things done like this. REally ***** until you figure it out. The problem is how they store the time and deal with it. Its never HH:mm:ss. Its always number of deciaml seconds past midnight, or the number of decimal days since a certain date.

Each program handles it a little differently, but once they open up scirpting and add-ons, I think we will see many of these get taken care of by us, the users.

Happy numbers,
Jason

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Time sheets with Numbers program

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.