Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula to Track Time Worked: A Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To track time worked in Excel, use the formula =(End_Time - Start_Time) * 24 and format the result as a Number. Because Excel treats one whole day as the value 1, subtracting two times results in a fraction of a day; multiplying by 24 converts that fraction into decimal hours, which is the standard format for payroll and time-tracking logs.

What You'll Need

  • A computer with Microsoft Excel installed (all versions) or access to Excel for the Web.
  • A basic understanding of how to enter data into cells.
  • A clear record of your start and end times, including whether you took unpaid breaks.

Step-by-Step

  1. Set Up Your Header Row: Open a new worksheet. In the first row, create headers to keep your data organized. In cell A1, type "Date"; in B1, type "Start Time"; in C1, type "End Time"; in D1, type "Break (Hours)"; and in E1, type "Total Hours". This structure ensures you have a dedicated place for every variable affecting the final calculation.
  2. Enter Your Time Data: In cell B2, enter your start time (e.g., "8:00 AM"). In cell C2, enter your end time (e.g., "5:00 PM"). It is critical to use a colon between the hour and minutes and to specify AM or PM so Excel recognizes the input as a Time value rather than a text string.
  3. Input Break Time: If you took a break, enter it in cell D2. Since we want the final result in decimal hours, enter your break as a number. For example, if you took a 30-minute break, enter "0.5". If you took a full hour, enter "1". If no break was taken, enter "0".
  4. Apply the Calculation Formula: Click on cell E2. Type the following formula: =((C2-B2)*24)-D2. This formula first subtracts the start time from the end time to find the elapsed time. It then multiplies that result by 24 to convert the Excel time-value into a decimal number of hours. Finally, it subtracts the break time you entered in cell D2.
  5. Format the Result Cell: By default, Excel may try to format cell E2 as a "Time" (showing something like 12:00 AM), which is incorrect for a total hour count. To fix this, right-click cell E2, select "Format Cells", choose the "Number" category, and set the decimal places to 2. Your total hours should now appear as a standard number (e.g., 8.50).
  6. Apply to Other Days: To track multiple days, click the small green square (fill handle) at the bottom-right corner of cell E2 and drag it down through the rest of your rows. This copies the formula to all subsequent days, automatically adjusting the cell references (B3, C3, D3, etc.) for each row.
  7. Calculate the Grand Total: To find the total hours worked for a week or month, go to the bottom of your "Total Hours" column. Use the AutoSum feature or type =SUM(E2:E31) (adjusting the range to match your actual data). Ensure this total cell is also formatted as a "Number".

Common Mistakes

One of the most frequent errors is entering times without the AM/PM designation or using a 24-hour clock inconsistently. If you type "8:00" and "5:00" without specifying, Excel may assume both are AM, resulting in a negative number or an error. Always be consistent with your time entry format.

Another common mistake is forgetting to multiply by 24. If you simply use =C2-B2, Excel provides the answer as a fraction of a day. For instance, 8 hours of work is 1/3 of a day. Excel will display this as "0.333" or as a time value like "8:00 AM", which is not useful for calculating pay based on an hourly rate.

Users often enter break times as minutes (e.g., typing "30" for 30 minutes) while the formula expects hours. If you enter "30" in the break column and subtract it from your total, Excel will subtract 30 full hours from your day, resulting in a large negative number. Always convert minutes to decimals (30 mins = 0.5, 15 mins = 0.25) before entering them into the break column.

Tips

To make data entry faster, use the keyboard shortcut Ctrl + Shift + : (colon) to insert the current time instantly into a cell. This is helpful for "punching in" and "punching out" in real-time.

If you frequently work shifts that cross over midnight (e.g., starting at 10:00 PM and ending at 6:00 AM), the standard subtraction formula will fail because the end time is numerically smaller than the start time. To fix this, use the MOD function: =MOD(C2-B2, 1)*24. The MOD function handles the date rollover automatically, ensuring the result remains positive regardless of whether the shift crossed midnight.

For those who prefer to enter breaks in minutes rather than decimals, you can modify the formula to =((C2-B2)*24)-(D2/60). This allows you to type "30" or "45" directly into the break cell, and Excel will handle the conversion to hours internally.

Troubleshooting

If your result appears as a series of hashtags (#######), it usually means the cell is too narrow to display the number, or the result of the formula is a negative time value. Check if your start time is later than your end time. If you are working an overnight shift, refer to the MOD function tip mentioned above.

If the result looks like a time (e.g., "4:30 AM") instead of a number (e.g., "4.5"), the cell formatting is the issue. Go to the "Home" tab on the ribbon, find the "Number" dropdown menu in the center, and change "Time" or "Custom" to "Number".

If the formula returns a #VALUE! error, it means one of the cells you are referencing contains text instead of a number or a valid time. Check for accidental spaces before or after your time entries, or ensure you didn't type "8am" without the colon (it should be "8:00 AM").

Frequently Asked Questions

How do I calculate pay based on these hours?

Once you have your total decimal hours in cell E2, create a "Hourly Rate" column (e.g., F2) and enter your pay rate. In a new "Total Pay" column, use the formula =E2*F2. Ensure the result cell is formatted as "Currency".

Can I track time using a 24-hour clock?

Yes. If you enter times as "13:00" and "17:00", Excel recognizes these as 1:00 PM and 5:00 PM. The subtraction and multiplication formulas will work exactly the same way.

How do I handle unpaid vs. paid breaks?

Only include unpaid breaks in the "Break (Hours)" column. If a break is paid, do not subtract it from the total; simply calculate the total elapsed time from start to end.

What is the best way to sum hours that exceed 24?

If you are summing total hours for a month and the total exceeds 24, Excel might "reset" the clock to zero. To prevent this, right-click the total cell, go to "Format Cells" > "Custom", and enter the code [h]:mm. The square brackets tell Excel to accumulate hours rather than wrapping them into a new day.

Does this work in Google Sheets?

Yes, the logic is identical. The formula =((C2-B2)*24)-D2 and the number formatting steps work the same way in Google Sheets as they do in Microsoft Excel.