Need formula to calculate elapsed time

Annotation 2020-04-27 103831.png

I need to be able to calculate the elapsed time into column C, where the times in column B are sporadic. In the illustration attached, the formula would be in column C next to 12:05 PM (column B is formatted as time). It needs to find the difference between the cell immediately to the left and the previous non-empty cell in the column.

I’d like to just plug the formula into all of column C, so it would also be aesthetically pleasing to leave a blank cell rather than an error message when there is nothing to calculate (i.e., all those blank lines between the times).

Thank you for any guidance!

to the left and the previous non-empty cell in the column

Really in the column? Not in row?

Please provide exactly which time difference (by values) you want to appear right to 12:05 PM in column C (Your description would make me assume you want 12:00 PM - 07:40 AM to appear right to 12:05 PM in column C, while the rest doesn’t support this assumption and would make me assume you simply want =IF(B1; B1-A1; "")

Thank you for your response. 4:05 should appear in the column next to 12:05 PM.

may be I’m stupid - but 4:05 calculates from which values? (This seems to introduce another algorithm and exactly has some extendend meaning to me )

Apologies! 4:25. 12:05 PM - 7:40AM

have you tried subtracting columnB - ColumnA ?