Keep Track of Time in Excel

imageIf you're working on a project, you might need to keep track of the time that you spend on its tasks. Later, you can tell a client how much time you've spent on their project, and get paid for your work. Or, you can use the time data to see how much of your day is spent on productive tasks, and how much is spent Googling and tweeting.

Enter the Current Time

To quickly enter the current time in Excel, you can use the keyboard shortcut:  Ctrl + Shift + ;

  • When you start a task, use the shortcut to enter the start time in one cell.
  • When you finish working on a task, use the shortcut in an adjacent cell, to enter the end time.

In the screen shot below, the Task start times are entered in column B and the end times are entered in column C.

timetrack01

Calculate the Elapsed Time

Based on the start and end times, you can calculated the elapsed time, by subtracting the start time from the end time.

In this example, I'll calculate the time in cell D2, using this formula:

=C2-B2

timetrack02

Format the Elapsed Time

There is a 15 minute difference in the start and end times in this example, but the result cell is showing a time – 12:15 AM

To see the result as hours and minutes of elapsed time, we'll change the formatting:

  1. Select cell D2, where the elapsed time is calculated
  2. Press Ctrl + 1 to open the Format Cells dialog box
  3. On the Number tab, click the Time category
  4. Click on the 37:30:55 format, then click OK

timetrack03

This format displays an overall total of hours, minutes and seconds. Cell D2 now shows the elapsed time of 15 minutes.

timetrack04 

Formula Error When No End Time

The formula works well if a start time and an end time have been entered. But there is a problem if only the start time has been entered.

The result in cell D3 is a negative number, because the start time is subtracted from zero (the value of empty cell C3).

Excel displays negative dates and times as #####.

timetrack05 

To avoid this problem, we'll change the formula in cell D2, and copy it down to cell D3:

=IF(C2="",0,C2-B2)

Now, the formula checks cell C2, and if it is empty, the formula result is zero.

timetrack06

Formula Error After Midnight

If you're burning the midnight oil on those client projects, you'll run into another error. In the screen shot below, the start time for Task 3 is 10:30 PM, and I worked past midnight – ending at 12:30 AM.

The formula result is a negative number, because the end time is smaller than the start time.

timetrack07

To fix this problem, we'll change the formula one last time. If the start time is greater than the end time, we'll assume that the task ended the next day.

In that case, we'll add 1 to the end time, which is the equivalent of adding a full day to the end time. That makes the end time greater than the start time, and the calculation will work correctly.

=IF(C2="",0,IF(B2>C2,1,0)+C2-B2)

timetrack08

Add the Task Times

To get the total time for all your tasks, use the SUM function. It should automatically format the total cell in the 37:30:55 format, but if not, you can format the cell manually.

=SUM(D2:D4)

timetrack09 

________________

Related Posts Plugin for WordPress, Blogger...

Share and Enjoy

  • Facebook
  • Twitter
  • LinkedIn
  • Google Plus
  • Pinterest

14 comments to Keep Track of Time in Excel

  • Jon

    I'm actually working on a time card in Excel right now. It's pretty close to being finished. If you're interested I can post when it is completed. I'll be offering it up for free, it's helping me to learn how to do different things in Excel with VB.NET. It's been fun so far! It should come out pretty nice.

    • William

      Hi Jon,
      I'm about to start working on a time sheet, and was seeing if I could take a look at your project. Thanks!

    • Debby

      Hi Jon,
      You posted you would offer your time sheet project. I am doing something similar where I work and would love to see how you did yours. I haven't gotten into the VB part of Excel and would like to see some completed projects to back my way in. I like to see the end results and then decipher how it was accomplished. If you could email me, it would be greatly appreciated.
      Thanks,
      Debby

  • Ola

    Negative time is not possible in Excel (other than by formatting, or number to text).
    This makes it especially difficult to make a bellshaped barcart chart around zero time deviation ----0++++ - from a pivottable.
    I tried both formulas =IF(A10>=0;"";"-")&TEXT(ABS(A10);"tt:mm"), and formatting [>=1]D\d tt:mm;[<0]-0,00;tt:mm but Excel 2010 Chart has an error so it doesn't work.
    Any other options?

  • ANAND

    EXCELENT SUPPORT FOR EXCEL FROM THIS SITE....THANKS

  • shyam

    Its good indeed, but any one can change the timings as per their wish.

    I mean to say if we working on sharing work book, so I can make changes in others time.

    so is there any way to track the time with out further corrections by any one.

    Need advise.

  • Karen

    I love the "after midnight" solution...have been trying to work this out for some time. But the formatting will not enable me to take the sum total and multiply it by a payrate (as in a timesheet application). Any help?

  • Karen

    Beautiful! Thanks, Debra!

  • Karen

    My timesheet is working great with one exception. When I enter the time 12:00 a.m., nothing shows up in the field...it's blank. This is the only "time figure" this happens for. The total hours worked are still calculated correctly and populate into the timesheet...but I have a blank for the end time field (I don't get the same problem with 12:00 p.m.). Any suggestions? Thanks!

    • @Karen, if your worksheet is formatted to hide zeros, then the midnight times won't show, because they are equal to zero.

      To turn zeros on:
      In Excel 2010, click the File tab, then click Options.
      In the Advanced category, scroll down and in the Display options for this worksheet, add a check mark to "Show a zero in cells that have zero value"
      Click OK to close the Options window.

  • Karen

    Many, many thanks! I applaud your Excel expertise.

  • Kach

    Thanks for the super quick response Debra "burning the midnight oil" ;)

  • Aziez

    Hi
    I would like to use excel to capture the time for an event. The starting time is known but the finish times will vary. Finish time needs to be in h,mm,ss. Would also like to use the space bar to capture the finish times. Any help out there? I'm not an advanced excel user.

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>