<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RainyChen</title>
    <description>The latest articles on DEV Community by RainyChen (@cc_df91c4a3f6d5a15f18577).</description>
    <link>https://dev.to/cc_df91c4a3f6d5a15f18577</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4115730%2F52d3e60e-9649-4fb6-8f39-1a3eeb4eb7ee.png</url>
      <title>DEV Community: RainyChen</title>
      <link>https://dev.to/cc_df91c4a3f6d5a15f18577</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cc_df91c4a3f6d5a15f18577"/>
    <language>en</language>
    <item>
      <title>How to Calculate Hours Worked in Excel Without Breaking Payroll Math</title>
      <dc:creator>RainyChen</dc:creator>
      <pubDate>Tue, 08 Sep 2026 12:41:33 +0000</pubDate>
      <link>https://dev.to/cc_df91c4a3f6d5a15f18577/how-to-calculate-hours-worked-in-excel-without-breaking-payroll-math-4o9i</link>
      <guid>https://dev.to/cc_df91c4a3f6d5a15f18577/how-to-calculate-hours-worked-in-excel-without-breaking-payroll-math-4o9i</guid>
      <description>&lt;p&gt;If you have ever built a timesheet, you have probably run into the same problem twice: clock times are easy for humans to read, but payroll systems want durations as decimal hours.&lt;/p&gt;

&lt;p&gt;A shift from &lt;code&gt;09:00&lt;/code&gt; to &lt;code&gt;17:30&lt;/code&gt; is not &lt;code&gt;9.5&lt;/code&gt; on a timesheet. It is &lt;code&gt;8.00&lt;/code&gt; hours if you subtract a 30-minute lunch, and payroll usually wants that written as &lt;code&gt;8.00&lt;/code&gt;, not &lt;code&gt;8:00&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we’ll walk through the Excel formulas, the edge cases, and the small time-math mistakes that cause real payroll problems.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Clock time and duration are not the same thing
&lt;/h2&gt;

&lt;p&gt;Before touching Excel, separate two ideas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clock time&lt;/strong&gt; answers “when did this happen?”&lt;br&gt;&lt;br&gt;
Examples: &lt;code&gt;09:00&lt;/code&gt;, &lt;code&gt;17:30&lt;/code&gt;, &lt;code&gt;22:00&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt; answers “how long did it last?”&lt;br&gt;&lt;br&gt;
Examples: &lt;code&gt;8 hours&lt;/code&gt;, &lt;code&gt;7.5 hours&lt;/code&gt;, &lt;code&gt;8.25 hours&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A timesheet usually starts with clock times, but payroll needs durations.&lt;/p&gt;

&lt;p&gt;That means you have to convert:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;09:00 → 17:30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8.00 decimal hours
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the duration is a decimal number, payroll can multiply it by an hourly rate.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The core Excel formula
&lt;/h2&gt;

&lt;p&gt;If Excel stores your start and end times correctly, the basic formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=(End - Start) * 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why multiply by 24?&lt;/p&gt;

&lt;p&gt;Because Excel represents time as a fraction of a day:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;06:00 = 0.25 days
12:00 = 0.50 days
18:00 = 0.75 days
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiplying by 24 converts that fraction into hours.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;A&lt;/th&gt;
&lt;th&gt;B&lt;/th&gt;
&lt;th&gt;C&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Start&lt;/td&gt;
&lt;td&gt;End&lt;/td&gt;
&lt;td&gt;Hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;09:00&lt;/td&gt;
&lt;td&gt;17:30&lt;/td&gt;
&lt;td&gt;8.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In &lt;code&gt;C2&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=(B2-A2)*24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8.00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure the result cell is formatted as a number, not as time.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Subtract an unpaid lunch break
&lt;/h2&gt;

&lt;p&gt;If the shift has an unpaid lunch, subtract it before multiplying by 24.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start: &lt;code&gt;09:00&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;End: &lt;code&gt;17:30&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Unpaid lunch: &lt;code&gt;30&lt;/code&gt; minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If lunch minutes are stored in &lt;code&gt;D2&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=((B2-A2)*24) - (D2/60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or if lunch is stored as &lt;code&gt;0:30&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=((B2-A2)-D2)*24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;17:30 - 09:00 = 8:00
8:00 - 0:30 = 7:30
7:30 = 7.50 decimal hours
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the payroll value is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not &lt;code&gt;7.30&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Why 7.30 is wrong
&lt;/h2&gt;

&lt;p&gt;This is the mistake that causes the most confusion.&lt;/p&gt;

&lt;p&gt;If you worked 7 hours 30 minutes, the decimal version is not &lt;code&gt;7.30&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7 + (30 ÷ 60)
= 7 + 0.50
= 7.50 decimal hours
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The decimal part represents a fraction of an hour, not the minute number.&lt;/p&gt;

&lt;p&gt;Another example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7 hours 45 minutes
= 7 + (45 ÷ 60)
= 7.75
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7:45 → 7.75
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not &lt;code&gt;7.45&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Handle shifts that cross midnight
&lt;/h2&gt;

&lt;p&gt;A normal subtraction breaks when a shift goes overnight.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start: 22:00
End:   06:00
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=(B2-A2)*24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Excel will return a negative number.&lt;/p&gt;

&lt;p&gt;The fix is to add one day when the end time is earlier than the start time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=((B2-A2) + IF(B2&amp;lt;A2, 1, 0)) * 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or more simply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=MOD(B2-A2, 1) * 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;code&gt;22:00&lt;/code&gt; to &lt;code&gt;06:00&lt;/code&gt;, the result is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8.00 decimal hours
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you also subtract a 30-minute unpaid lunch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8.00 - 0.50 = 7.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Convert HH:MM into decimal hours manually
&lt;/h2&gt;

&lt;p&gt;If you have hours in one column and minutes in another:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hours&lt;/th&gt;
&lt;th&gt;Minutes&lt;/th&gt;
&lt;th&gt;Decimal hours&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;td&gt;7.75&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Formula:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=A2 + (B2/60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the safest formula when your data already separates hours and minutes.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;7h 15m = 7.25
7h 30m = 7.50
7h 45m = 7.75
8h 20m = 8.3333
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Payroll systems commonly round to two decimal places, so &lt;code&gt;8.3333&lt;/code&gt; may become &lt;code&gt;8.33&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Calculate a weekly total
&lt;/h2&gt;

&lt;p&gt;Once every day is in decimal hours, the weekly total is just a sum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=SUM(C2:C8)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Day&lt;/th&gt;
&lt;th&gt;Decimal hours&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mon&lt;/td&gt;
&lt;td&gt;8.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tue&lt;/td&gt;
&lt;td&gt;7.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wed&lt;/td&gt;
&lt;td&gt;8.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thu&lt;/td&gt;
&lt;td&gt;7.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri&lt;/td&gt;
&lt;td&gt;8.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39.50&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Do not sum clock times like &lt;code&gt;8:00&lt;/code&gt;, &lt;code&gt;7:30&lt;/code&gt;, and &lt;code&gt;8:15&lt;/code&gt; and then treat the result as payroll hours. Convert first, then sum.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Split regular and overtime hours
&lt;/h2&gt;

&lt;p&gt;If overtime starts after 40 hours in a workweek:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Regular hours:
=MIN(WeeklyTotal, 40)

Overtime hours:
=MAX(0, WeeklyTotal - 40)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Weekly total = 43.75
Regular      = 40.00
Overtime     = 3.75
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your hourly rate is in &lt;code&gt;E2&lt;/code&gt; and overtime is paid at 1.5×:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Regular pay:
=MIN(C2,40) * E2

Overtime pay:
=MAX(0,C2-40) * E2 * 1.5

Total pay:
=Regular pay + Overtime pay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At $20.00/hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Regular pay:  40 × $20.00 = $800.00
Overtime pay: 3.75 × $30.00 = $112.50
Total gross:  $912.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  9. Avoid the four most common mistakes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mistake 1: Treating 4.35 as 4 hours 35 minutes
&lt;/h3&gt;

&lt;p&gt;It is not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4.35 hours = 4 hours + 0.35 of an hour
0.35 × 60 = 21 minutes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So &lt;code&gt;4.35&lt;/code&gt; is 4 hours 21 minutes.&lt;/p&gt;

&lt;p&gt;If you worked 4 hours 35 minutes, the payroll value is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4 + (35 ÷ 60) = 4.58
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Mistake 2: Subtracting paid breaks
&lt;/h3&gt;

&lt;p&gt;Only subtract unpaid lunch or unpaid breaks if your employer does not count them as hours worked.&lt;/p&gt;

&lt;p&gt;If a break is paid, leave it inside the duration.&lt;/p&gt;




&lt;h3&gt;
  
  
  Mistake 3: Mixing clock time and duration
&lt;/h3&gt;

&lt;p&gt;A clock time like &lt;code&gt;14:30&lt;/code&gt; is not the same as &lt;code&gt;14.30 hours&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;14:30&lt;/code&gt; is a time of day.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;14.30 hours&lt;/code&gt; is a duration.&lt;/p&gt;

&lt;p&gt;Convert durations to decimal hours before payroll calculations.&lt;/p&gt;




&lt;h3&gt;
  
  
  Mistake 4: Rounding before checking the rule
&lt;/h3&gt;

&lt;p&gt;Some employers round clock times to the nearest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5 minutes&lt;/li&gt;
&lt;li&gt;6 minutes&lt;/li&gt;
&lt;li&gt;10 minutes&lt;/li&gt;
&lt;li&gt;15 minutes&lt;/li&gt;
&lt;li&gt;1/10 hour&lt;/li&gt;
&lt;li&gt;1/100 hour&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rounding rule matters because two different rules can produce different totals.&lt;/p&gt;

&lt;p&gt;If you are auditing a paycheck, apply the same rule your employer uses before comparing your result.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. A compact Excel template
&lt;/h2&gt;

&lt;p&gt;A simple timesheet layout can look like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Day&lt;/th&gt;
&lt;th&gt;Start&lt;/th&gt;
&lt;th&gt;End&lt;/th&gt;
&lt;th&gt;Unpaid lunch&lt;/th&gt;
&lt;th&gt;Decimal hours&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mon&lt;/td&gt;
&lt;td&gt;09:00&lt;/td&gt;
&lt;td&gt;17:30&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;7.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tue&lt;/td&gt;
&lt;td&gt;08:30&lt;/td&gt;
&lt;td&gt;17:00&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;8.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wed&lt;/td&gt;
&lt;td&gt;09:15&lt;/td&gt;
&lt;td&gt;17:45&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;8.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thu&lt;/td&gt;
&lt;td&gt;08:00&lt;/td&gt;
&lt;td&gt;16:30&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;8.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri&lt;/td&gt;
&lt;td&gt;09:00&lt;/td&gt;
&lt;td&gt;15:45&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;6.25&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For a shift that may cross midnight:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=MOD(B2-A2,1)*24 - (D2/60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a normal shift:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=(B2-A2)*24 - (D2/60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A safer universal formula is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=MOD(B2-A2,1)*24 - (D2/60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then sum the decimal hours column.&lt;/p&gt;




&lt;h2&gt;
  
  
  Free calculator
&lt;/h2&gt;

&lt;p&gt;If you want to check your Excel formulas without rebuilding the whole sheet, I built a free Weekly Timesheet Calculator that handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clock-in and clock-out times&lt;/li&gt;
&lt;li&gt;Unpaid lunch breaks&lt;/li&gt;
&lt;li&gt;Overnight shifts&lt;/li&gt;
&lt;li&gt;Weekly totals&lt;/li&gt;
&lt;li&gt;Regular and overtime hour splitting&lt;/li&gt;
&lt;li&gt;Estimated gross pay&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It runs entirely in the browser and does not require an account:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.minutestodecimal.org/weekly-timesheet-calculator" rel="noopener noreferrer"&gt;Weekly Timesheet Calculator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is also a full minutes-to-decimal chart here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.minutestodecimal.org/minutes-to-decimal-chart" rel="noopener noreferrer"&gt;Minutes to Decimal Conversion Chart&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The core idea is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;decimal hours = hours + (minutes ÷ 60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For clock times in Excel:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=(End - Start) * 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For overnight shifts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=MOD(End - Start, 1) * 24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For unpaid lunch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;=MOD(End - Start, 1) * 24 - (UnpaidLunchMinutes / 60)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Convert first, sum second, and split overtime only after you know the weekly total.&lt;/p&gt;

&lt;p&gt;That small order of operations will save you a lot of payroll headaches.&lt;/p&gt;

</description>
      <category>excel</category>
      <category>javascript</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
