Iterate over split cell

时间:2019-04-24 14:12:34

标签: google-sheets spreadsheet google-sheets-formula

I'm setting up a time tracking spreadsheet, is there a possibility to iterate over a split cell?

E.g. an input can be 09:00-17:00 which will output 8 when using =(index(SPLIT(CELL, " - "), 0, 2) - index(SPLIT(CELL, " - "), 0, 1))*24

But I'd also like it to work over multiple time frames such as: 09:00-13:00,14:00-17:00 work on the 1-time frame but also on 10. Which should thus output 7, but I don't want to temporarily save a split result into other cells.

Is this possible?

1 个答案:

答案 0 :(得分:0)

=ARRAYFORMULA(TEXT(QUERY(TIMEVALUE(SPLIT(A43, "-")), 
 "select Col2-Col1 label Col2-Col1''"), "hh:mm"))

0