Search code examples
google-sheets

Average between timestamps


Im trying to make myself a formula to be able to analyse my data in a better way. I have temperature data from 1 hour, measured every second. Now i want to be able to get the average temperatuur between the timestamps I wrote down.

For example, I measured temperature data between 9:00 and 10:00. and want the average temperature between 9:00 and 9:02.

I wrote this formula with the help of an old excel sheet who did the same, but its not working so far =ARRAY_CONSTRAIN(ARRAYFORMULA(Average(data!M:M(data!E:E)*(data!E:E>=C3)*(data!E:E<D3))))

In this formula:

  • data is the data tab
  • M column is the temperature
  • E are the timestamps in the data tab
  • C3 - D3 the 2 timestamps (start and stop) where i want to get the average data from

Thanks in advance!


Solution

  • Try:

    =average(filter(M:M,(E:E>=C3)*(E:E<=D3)))
    

    Result:

    enter image description here

    Adapt sheet names as needed.