Forum Discussion

rutilusss's avatar
rutilusss
Copper Contributor
Feb 20, 2020

How to count average in certain time range

Hello Excel wizards,

 

I'm not the best with Excel so I would like to ask for help with this problem I have.

 

I have 8 hours of measurement data and I want to know 30 minute averages in certain times.

 

Column A is for time (HH:mm) and B-F are measurement values. I have always calculated averages manually in each time frame, but now I want to make a tool where I can just import the data and set time criteria. For example, if the data is recorded from 08:00 to 16:00, and I want to know the average at 12:00-12:30. What function to use to add a value into average calculation if time is greater or equal to start time (12:00) and lower or equal than end time (12:30).

 

Sorry for confusing question and thanks for any help!

6 Replies

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    Suppose you have 12:00 in cell A1 and 12:30 in B1 and your data starts on row 3:
    =AVERAGEIFS($B$3:$F$100,A3:A100,">="&A1,A3:A100,"<="&B1)
    • rutilusss's avatar
      rutilusss
      Copper Contributor

      JKPieterse 

       

      Hi Jan,

       

      Thanks for your help!

       

      I used your formula but it returns #DIV/0!. 

       

      I tried to find an explanation for this but I can't get it work...

       

      Any tips would be highly appreciated!

       

       

      In that example I was trying to calculate it only for column B. 

       

      • JKPieterse's avatar
        JKPieterse
        Silver Contributor
        What is in the cells in column A *precisely*? If you change their number format to general, what do they show?

Resources