Google-sheets – How to sum up occurrences from range

formulasgoogle sheets

I am attempting to calculate how many same duration between two timestamps I have in a given range.

The range is Sheet1!A1:B10. I have two columns – first consists of starting time and second consist of ending time. So far I am able to count duration with formulae =B1-A1 which returns 8:30. Is there a way how to count occurrences at a given range and sum them up and print it in a cell of Sheet2?

Example sample:

A     | B 
01:00 | 09:00
01:30 | 12:00
02:45 | 10:45
00:00 | 08:30
04:00 | 12:00
10:00 | 18:30

Best Answer

try this: add 1 more column with =COUNTIF(B2-A2,"="&"8:30")

and then you can sum this column with a formula: =SUM(Sheet1!C1:C10)*8.50