Hi all and apologies for the rapidfire queries. I have the following scenario.
Sheet1 has data in columns per component and date
Eg
Cl F Mg
10/10/2002 6.7 9.4 6.1
10/10/2002 7.2 5.76
11/10/2002 3.21 9.3 6.13
etc
I have a subroutine that selects all the data for every day. What I need to do is on sheet2, enter a formula for the average and variance. Initially, what I did was to:
Select all cells for a particular component and day.
Eg cells containing 6.7 and 7.2 (Cl on 10/10/2002)
For Each Cll In Selection.Cells
If ((IsNumeric(Cll.Value)) And (Not (IsEmpty(Cll.Value)))) Then
strLoc = strLoc & ", " & Cll.Address
End If
Next
strLoc = Mid(strLoc, 3) ' & Chr(34)
Range(strLoc).Select
I select strLoc. Then I try to work out the average and variance of these, which gives me a formula something like
=AVERAGE(Sheet1!$B$11,$B$12,$B$13,$B$14)
=VAR(Sheet1!$B$15, B16, B17, $B$18)
There are 2 problems:
Firstly, =AVERAGE(Sheet1!$B$11,$B$12,$B$13,$B$14) is not equal to =AVERAGE(Sheet1!$B$11:$B$14)
The other formula returns an error. I need to use the formula
=VAR(Sheet1!$B$15:$B$18)
Someone please put me out of my misery...
thanks
Sheet1 has data in columns per component and date
Eg
Cl F Mg
10/10/2002 6.7 9.4 6.1
10/10/2002 7.2 5.76
11/10/2002 3.21 9.3 6.13
etc
I have a subroutine that selects all the data for every day. What I need to do is on sheet2, enter a formula for the average and variance. Initially, what I did was to:
Select all cells for a particular component and day.
Eg cells containing 6.7 and 7.2 (Cl on 10/10/2002)
For Each Cll In Selection.Cells
If ((IsNumeric(Cll.Value)) And (Not (IsEmpty(Cll.Value)))) Then
strLoc = strLoc & ", " & Cll.Address
End If
Next
strLoc = Mid(strLoc, 3) ' & Chr(34)
Range(strLoc).Select
I select strLoc. Then I try to work out the average and variance of these, which gives me a formula something like
=AVERAGE(Sheet1!$B$11,$B$12,$B$13,$B$14)
=VAR(Sheet1!$B$15, B16, B17, $B$18)
There are 2 problems:
Firstly, =AVERAGE(Sheet1!$B$11,$B$12,$B$13,$B$14) is not equal to =AVERAGE(Sheet1!$B$11:$B$14)
The other formula returns an error. I need to use the formula
=VAR(Sheet1!$B$15:$B$18)
Someone please put me out of my misery...
thanks