B
Biff
Here's an alternative method:
Assume the following:
20 wks of data = 140 dated entries = 140 rows of data.
You want 5 weeks of data averaged so there are 4 groups.
Col A = date
col B = weekday
Col C:Z = 24 hourly values
Row 1 A1:Z1 = headers
So, the actual data is in the range A2:Z141
In AA2 enter: =MAX(C2:Z2)
Double click the fill handle to copy the formula down to
AA141.
Now, setup a data table to hold the averages:
In AC2:AC8 enter the weekdays in the same format as you
have them entered in col B - Mon,Tue,Wed or Monday,
Tuesday etc.
In AD1:AG1 enter your headers that define the four
different 5 week periods.
Enter these array formulas, CTRL+SHIFT+ENTER, in the
following cells:
AD2 =AVERAGE(IF($A$2:$A$140>=$A$2,IF
($A$2:$A$140<=$A$2+34,IF($B$2:$B$140=$AC2,$AA$2:$AA$140))))
AE2 =AVERAGE(IF($A$2:$A$140>=$A$2+35,IF
($A$2:$A$140<=$A$2+69,IF($B$2:$B$140=$AC2,$AA$2:$AA$140))))
AF2 =AVERAGE(IF($A$2:$A$140>=$A$2+70,IF
($A$2:$A$140<=$A$2+104,IF
($B$2:$B$140=$AC2,$AA$2:$AA$140))))
AG2 =AVERAGE(IF($A$2:$A$140>=$A$2+105,IF
($A$2:$A$140<=$A$2+139,IF
($B$2:$B$140=$AC2,$AA$2:$AA$140))))
Now select the range AD2:AG2 and double click the fill
handle to copy the formulas and fill the data table with
the averages.
Biff
Assume the following:
20 wks of data = 140 dated entries = 140 rows of data.
You want 5 weeks of data averaged so there are 4 groups.
Col A = date
col B = weekday
Col C:Z = 24 hourly values
Row 1 A1:Z1 = headers
So, the actual data is in the range A2:Z141
In AA2 enter: =MAX(C2:Z2)
Double click the fill handle to copy the formula down to
AA141.
Now, setup a data table to hold the averages:
In AC2:AC8 enter the weekdays in the same format as you
have them entered in col B - Mon,Tue,Wed or Monday,
Tuesday etc.
In AD1:AG1 enter your headers that define the four
different 5 week periods.
Enter these array formulas, CTRL+SHIFT+ENTER, in the
following cells:
AD2 =AVERAGE(IF($A$2:$A$140>=$A$2,IF
($A$2:$A$140<=$A$2+34,IF($B$2:$B$140=$AC2,$AA$2:$AA$140))))
AE2 =AVERAGE(IF($A$2:$A$140>=$A$2+35,IF
($A$2:$A$140<=$A$2+69,IF($B$2:$B$140=$AC2,$AA$2:$AA$140))))
AF2 =AVERAGE(IF($A$2:$A$140>=$A$2+70,IF
($A$2:$A$140<=$A$2+104,IF
($B$2:$B$140=$AC2,$AA$2:$AA$140))))
AG2 =AVERAGE(IF($A$2:$A$140>=$A$2+105,IF
($A$2:$A$140<=$A$2+139,IF
($B$2:$B$140=$AC2,$AA$2:$AA$140))))
Now select the range AD2:AG2 and double click the fill
handle to copy the formulas and fill the data table with
the averages.
Biff