A
A.Eglauer
I have data in C21:E86 which represent test results on certain days.
The date of the test is in column C, the machine name is in column D
and the test result is in column E. There are 3 different types of
machines and the dates range over several months. What I wish to do
is calculate an average test result for the most recent week (I don't
mean the last 7 days, I mean the average results from last Saturday to
this Friday). I can do that, but when I filter the results based on
the type of machine, the average still calculates for all the machines
in the last week. I am using the SUBTOTAL, INDIRECT and ADDRESS
functions to select the range of results from last Saturday to this
Friday.
It seems the INDIRECT pulls the actual values from the results, so
filtering the data makes no difference on the SUBTOTAL function.
The formula I have in cell E14 (the calculation is above all the data)
is:
=SUBTOTAL(1,(INDIRECT(ADDRESS(MATCH($K$10,$C$21:$C$86,1)+20,COLUMN())):INDIRECT(ADDRESS(MATCH($K$10-7,$C$21:$C$86)+21,COLUMN()))))
In $K$10 I have calculated "this Friday's date" as follows:
=MAX($C$21:$C$86)+6-WEEKDAY(MAX($C$21:$C$86))
Can anyone help out? I'd appreciate a response to the e-mail address
provided as well, if it's not too much trouble.
Thanks,
Armand
The date of the test is in column C, the machine name is in column D
and the test result is in column E. There are 3 different types of
machines and the dates range over several months. What I wish to do
is calculate an average test result for the most recent week (I don't
mean the last 7 days, I mean the average results from last Saturday to
this Friday). I can do that, but when I filter the results based on
the type of machine, the average still calculates for all the machines
in the last week. I am using the SUBTOTAL, INDIRECT and ADDRESS
functions to select the range of results from last Saturday to this
Friday.
It seems the INDIRECT pulls the actual values from the results, so
filtering the data makes no difference on the SUBTOTAL function.
The formula I have in cell E14 (the calculation is above all the data)
is:
=SUBTOTAL(1,(INDIRECT(ADDRESS(MATCH($K$10,$C$21:$C$86,1)+20,COLUMN())):INDIRECT(ADDRESS(MATCH($K$10-7,$C$21:$C$86)+21,COLUMN()))))
In $K$10 I have calculated "this Friday's date" as follows:
=MAX($C$21:$C$86)+6-WEEKDAY(MAX($C$21:$C$86))
Can anyone help out? I'd appreciate a response to the e-mail address
provided as well, if it's not too much trouble.
Thanks,
Armand