How do I analyze temperature and humidity data?

Copper Contributor

I have an excel file with columns of date and time, temperature and humidity data, with rows of samples taken every ten minutes.

I want to determine the amount of time temperature and humidity were at or above 24° and 42% simultaneously. Also, rows only count if the rows before and after are also within target parameters. As a result, only two rows are fully within parameters in the sample below:

 

2020-11-26 20:02:24 22.69° 45.1%
2020-11-26 20:12:24 23.19° 45.8%
2020-11-26 20:22:24 23.81° 45.1%
2020-11-26 20:32:24 24.13° 44.3%
2020-11-26 20:42:24 24.19° 43.8%
2020-11-26 20:52:24 24.19° 43.6%
2020-11-26 21:02:24 24.06° 43.5%
2020-11-26 21:12:24 23.94° 43.4%
2020-11-26 21:22:24 23.81° 43.4%
2020-11-26 21:32:24 23.69° 43.4%

 

How could I count the total amount of time (days, hours and minutes) the values were in the ranges specified above, with the condition that the row before and after must be within range for a row to count?

 

EDIT: corrected temperature target from 22° to 24°.

1 Reply

@MonkeyNotAvailable 

I'd use a helper column. Let's say the temperatures are in column C, and the humidity data in column D, starting in row 2.

Enter the following formula in E3 (we don't need a formula in E2, since there is no data row above it):

 

=COUNTIFS(C2:C4,">=24",D2:D4,">=42%")=3

 

Fill down.

The formula returning the number you want is

 

=COUNTIF(E:E,TRUE)