As about calculating totals, it is easy - use SUMIFS()! You add the time in row either when code cell is empty, or the code cell equals your single valid value for it, or OR(CodeCell=ValidValue1, CodeCell=ValidValue2, ...) = True, or OR(CodeCell<>"VASC", CodeCell<>"OFF",...) = True (using last 2 depending which has less values to compare).
About times. As it follows from your post, your time intervals can be over midnight. It is possible to calculate the length of time intervals for such cases using time value, but it means you always have to make an additional comparision to check, has the start time bigger value as end time (and this works only, when there never will be time intervals over 24 hours). Much easier (and much safer) way will be to enter start and end time values as datetime ones (like 28.11.2023 10:00). In case this is really a NO for you, the another option is to have calculated columns for StartDateTime and EndDataTime, and use them in your calculations.
About time formats you use - unless you enter times as strings, it doesn't count. The format used to display date or time don't change the value, it only changes how you will see it!
|