As squatty implied it is really, really easy to do. As you have teh dates in the left column (e.g. A2, A3, etc), put your tags across the top row(e.g. B1, C1, etc).
In cell B2 create your formula
=PIAdvCalcVal(“INSERT SPECIFIC TAGNAME”,” 31-aug-11 00:00:00”,” 31-aug-11 23:59:59”,”average”,”time-weighted”,0,1,1)
and with cell references:
=PIAdvCalcVal(B$1, $A2, $A2+1,”average”,”time-weighted”,0,1,1)
Copy this formula to the rest of your table. Each time you recalculate sheet the averages will be recalculated and the results will update - just like other Excel formulas. However as you quite rightly say the historical ones will be static. As the number of values returned increases performance will reduce. Simply copy and Paste Special as values once ina while for the values more than a day old.
If you have the PI Datalink addin and a 'connection' to PI set up then a simple press of F9 should recalcualte for you. Automatic calculation should also work but may require something on the sheet to change (like an =NOW formula) to nudge the auto recalc.
You can also use this simpler formula:
=PICalcVal(B$1,$A2,$A2+1,"average", 1, 0,pi_server)
all the best,
Miles
MilesUK
ProcessBook v3.0.15.3