+ Reply to Thread
Results 1 to 21 of 21

How to count hours

Hybrid View

  1. #1
    Registered User
    Join Date
    09-29-2008
    Location
    New York
    Posts
    8

    How to count hours

    Hello Group,

    I'm NEW here. I just wondering how to count the hours using Excel cells (for time table scheduling)....for example : 11:00-9:00 is 10 hours, "OFF" is 0 hour, "X" means 0 also, 10:00-7:00 is 9 hours, and so on. But when I try to put the hours, they show ###### in the cells? I know the time table is mixed with numbers and letters, that's why I'm confused to use any formula to do it, but my boss told me NOT to change the original format what so ever. Thx in advance.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Welcome to the forum.

    Post an example and desired results?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-29-2008
    Location
    Maryland
    Posts
    4
    I have had this problem over the years.
    I solved it by using a series of formulae in cells, and later by writing a macro and checking for various eventualities.

    But I cannot understand why Microsoft doesn't ecognize, and a provide a Time variable of the Time Interval type.

    Think of values of time segments for several steps of a problem. If these are entered in a column, and you want a sum of all the individual time segments, Excel seems to be uncapble of processing that.

    Or am I unaware of some functionality that is already there?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I cannot understand why Microsoft doesn't ecognize, and a provide a Time variable of the Time Interval type.
    5 - 2 = 3. Is 3 an interval number or an absolute number?
    ... want a sum of all the individual time segments, Excel seems to be uncapble ...
    Excel is very capable of this and people do it routinely, but the information you're providing isn't getting you any closer to finding out how.
    Last edited by shg; 09-29-2008 at 01:10 PM.

  5. #5
    Registered User
    Join Date
    09-29-2008
    Location
    New York
    Posts
    8
    Hi shg,

    Like I mentioned before...when I put in one cell "11:00 - 9:00" the result should be 10 hours ((12-11) + 9). And then, when I put "Off" or "X" the result should be 0 hour. If I put "7:00 - 3:00" the result should be 8 hours ((12-7) + 3). My Boss won't use Military hours (which is easier for me), so what formula shoud I do that? Thx again.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Put the numbers in two separate cells, subtract normally, and format the result as [h]:mm
          ---A---- ---B--- --C-- ----D-----
      1   11:00 AM 9:00 PM 10:00 C1: =B1-A1
    If you want to do it in one cell (but why?), you can enter it as ="9:00 PM" - "11:00 AM"
    Last edited by shg; 09-29-2008 at 03:40 PM.

  7. #7
    Registered User
    Join Date
    09-29-2008
    Location
    New York
    Posts
    8
    Well, that's so much easier if I could do it that way, shg. But he's kinda stubborn (old guy kinda thing), and he wants the time table "as is". So, I'm so frustrated in explaining to him accordingly...numbers & letters WON'T be possible mixing (unless in a subroutine C prog or something). Can I send you a screen sample of it, shg? Much appreciate it.

  8. #8
    Forum Contributor
    Join Date
    08-22-2008
    Location
    S-o-t
    MS-Off Ver
    Office 2000 & 2010
    Posts
    166
    Hi

    Please see the attachment maybe this will help

    You can doubleclick cells E,I,M,Q,U,Y,AC to get a userform for the times

    And you can doubleclick B,D,F,H on so on to adjust the times.

    Play about with it and change the VB to suit your needs.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-29-2008
    Location
    New York
    Posts
    8
    Well, if I upload the spreadsheet...it's kinda big. That's why I just grabbed the on screen (portion of it)! But I guess, you got the picture now...Thx for your input & Dave69rock as well. I'll try to analyze it first then. BTW, too bad d BOYZ lost last nite (my big bro is a die-hard fan), I hope my team will win tonite (Steelers that is). Take care now...

  10. #10
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949
    I'm a little confused as per the format you're expected to enter.
    Looking at your picture there's no am or pm, if you're not using military time, how do you have any idea what hours a person worked? Also, many cells on that pic simply have one time on them, such as "5:00". Does that mean the person worked five hours? Or that they worked from a specific time 'till 5?

  11. #11
    Registered User
    Join Date
    09-29-2008
    Location
    New York
    Posts
    8
    Hi Mewingkitty,

    If only 1 time mention (let's just say 5:00) that means he/ she works for 1 hour ONLY...well, if I use military time it would much much easier...because for example : 1100-2100 (instead of 11:00-9:00) I could formulate to 10 hours. C what I'm gettin' at?

  12. #12
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Nightmare time sheet

    As always, the more set in their ways a person is, the harder it is to write code which will be compatible with their system.

    This will work if and ONLY if you type in times in the exact format which are given in the examples. And, as SHG stated, this one will also only work on hours in the same day.

    That,
    and it's 24 lines of code.
    Been a little slow in the office here today :P

    I left the steps which I took at the bottom, so you can go over the progression of the nightmare of gobbledeegook which is the final result.

    Lemme know what you think, I'm still kinda new to this, so I'm mashing what I know with examples I find in order to make stuff work the way I want it to.
    Attached Files Attached Files
    Last edited by mewingkitty; 09-29-2008 at 06:52 PM.

  13. #13
    Registered User
    Join Date
    09-29-2008
    Location
    New York
    Posts
    8
    I appreciate it, Mewingkitty & others to help me out... I'm still a bit sleepy today after watching the game until late...

  14. #14
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    One more thing

    Added in the part about having an x or the word off mean 0. Didn't do anything for the one hour thing though, since I'm not sure if you pay your guys for one hour if they work an hour. Last time I checked that's not legal :P You could still put in 5:00pm - 6:00pm.

    Cheers.

    By the way, if anyone has a simpler way to do this (I'm assuming it could be done with an array a lot easier.. somehow. I didn't know arrays were an option until this morning.) by all means give me a heads up. I usually find ways to get my objective completed, but I think my approach could use some streamlining.

    Thanks!
    Attached Files Attached Files
    Last edited by mewingkitty; 09-30-2008 at 02:30 PM.

  15. #15
    Registered User
    Join Date
    12-27-2013
    Location
    Qld Australia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Thumbs up Re: How to count hours

    Thanks guys, with the help of your thread i have been able to complete a tracking sheet i was working on to calculate my own hrs and wage.

  16. #16
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949
    It's Excel 2007. I can't convert it to 2003, there's way too many nests. That's why I was asking if anyone could show me how to simplify the commands.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Count numbers of times within hours
    By dreicer_Jarr in forum Excel General
    Replies: 3
    Last Post: 06-24-2015, 09:49 PM
  2. Counting days and hours
    By roddie in forum Excel General
    Replies: 15
    Last Post: 09-11-2008, 05:15 AM
  3. count hours past midnight
    By cojast in forum Excel General
    Replies: 3
    Last Post: 07-01-2008, 03:53 PM
  4. Count the hours of each day for the month
    By kdraper in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2007, 06:42 AM
  5. enhanced hours
    By each in forum Excel General
    Replies: 1
    Last Post: 11-04-2006, 07:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1