Forum Discussion

ROjer9's avatar
ROjer9
Copper Contributor
May 12, 2023
Solved

CountIFS and sequencing: Weather example

Hi,

 

I currently have a sheet with two columns, column A is the date and column B is the weather (rain, sun, snow, cloudy)

 

Row 1 are the headings Date, and Weather

 

I logged the weather for each day using either rain, sun, snow or cloudy for the calendar month of january.

 

If consecutive dates had the same weather i.e rain, i would like to count that as one occurance of rain.

 

What i would like to produce is a weather report for that month of how many occurances (again an occurance could be multiple days) of each weather happened in that month, and the average number of days the weather lasted for per occurance.

 

E.g.

 

1/1 rain

2/1 rain

3/1 rain

4/1 cloudy

5/1 rain

6/1 cloudy

7/1 rain

8/1 rain

 

3 occurances of rain (3 days, 2 days, 1 day) with an average of 2 days per occurance of rain

 

2 occurances of cloudy, with an average of 1 day per occurance

 

Thank you in advance

 

Cheers

 

Dan

5 Replies

    • ROjer9's avatar
      ROjer9
      Copper Contributor
      What an absolute hero! Thank you so much!

      The next question is:

      That is for one town, if i have two cities, and want to combine output across two towns;

      Town 1 town 2
      Rain rain
      Rain sun
      Sun sun
      Rain rain
      Rain rain
      Sun sun
      Sun sun
      Rain sun

      So the output is
      5 occurances of rain, avg 1.6days
      4 occurances of sun, avg 2days

      How would i do that?

      Cheers

      Dan

Resources