Search code examples
google-sheetstimesumgoogle-sheets-formulaforecast

Time difference With 0 Values


Im having a problem in google sheets. I want to sum 2 columns the time that a driver is driving without the stops. So im using this formula to do it:

enter image description here

enter image description here

G7 is 10:20 value and H6 is 10:00.

But I want to do it in all the lines, but when I use the same formula:

enter image description here

I get this value:

enter image description here

Any idea how can I ignore the zero values that are making my database giving me wrong values when in this example the result I want is 00:40. The time driving without the unloads?


Solution

  • use:

    =TEXT(SUMPRODUCT(IF(G7:G20="";;G7:G20-H6:H19)); "[h]:mm")
    

    enter image description here