Start is the named range G5, which is used by formulas in columns C and D, as explained below. The first step is to calculate the decimal hours as seen in column C. We could also work with Excel time, but decimal hours are more convenient when we calculate the day labels later below. The formula in C5, copied down, is: We subtract the start time from the end time and multiply by 24. This works because Excel times are fractional values of days. Next, we calculate the decimal days that appear in column D by subtracting the start time from the end time. The formula in D5, copied down, is: This works because Excel dates are just serial numbers. These values are only for reference, and are not used in any subsequent calculations. Finally, to calculate the day labels as seen in column E, we use a formula based on the IFS function with 4 logical conditions: For each logical test, we supply a text value that works like a bucket to collect times the appropriate day range. The IFS function is new in Excel 2019. If you don’t have IFS available in your version of Excel, you can use a formula that “nests” together several IF functions: For more information on nesting IFs, see: 19 tips for nested IF formulas.
Dave Bruns
Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.