You have a start time and an end time, and you want to know how many of the hours in between these two times overlap another time period in the day. For example, you want to know how many hours fall between 8:00 AM and 5:00 PM, or 7:00 PM to 7:00 AM, etc.
You might need this information to calculate different hourly rates or different service charges depending on what time of day the work occurred. For instance, you might pay one rate for hours logged between 7:00 PM to 7:00 AM and a different rate for hours outside that period.
In this example, we first calculate the total hours between the start time and end time. Then we figure out the total hours that overlap "the period of interest". Using these two values, we can figure out all remaining hours.
In all formulas, "lower" represents the first time (lower bound) in the time period of interest, and upper represents the second time (upper bound).
To calculate total hours between start and end time, the formula in D5 is:
To calculate the number of hours between two times, you can use a formula that simply subtracts the start time from the end time. This is useful to calculate working time, calculate elapsed time, etc. However, when times cross a day boundary (...
To calculate overtime and pay associated with overtime, you can use the formulas explained on this page. In formula in cell I5 is: = ( F5 * H5 ) + ( G5 * H5 * 1.5 ) How this formula works Note: it's important to understand that Excel deals with time...
To calculate work hours, taking into account break time that needs to be subtracted, you can use a formula based on the MOD function. MOD is used to handle start and end times that cross midnight. In the example shown, the formula in F6 is: = MOD (...
The Excel MAX function returns the largest numeric value in a range of values. The MAX function ignores empty cells, the logical values TRUE and FALSE, and text values.
Excel Formula Training
Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.