3

enter image description here

I'm trying to calculate the time difference and get the result 04:00. This obviously doesn't work because MINUS expects 2 arguments and instead gets a range.

Generally, is there a way to output a range into a function kind of like the ES6 spread syntax in Javascript?

3

You can use

=INDEX(SPLIT(F22, " - "),,2) - 
 INDEX(SPLIT(F22, " - "),,1)

enter image description here

This means we split the same cell twice.
Using INDEX we use the second column of the first split minus the first column of the second split.
(Of course you should format the result as duration.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.