Excel Define Range
1 answer
According to Matthew Flashen, VBA is unnecessary. This can be done using Excel formulas.
Suppose your data is in column A starting at A1 and going down. Suppose cell B1 has number x, which is the sample size you want to use.
Then the required formula should be:
=VAR(OFFSET(A1,0,0,B1,1))
The VAR part says it calculates the variance of a sample of the population, ignoring non-zero numbers. (Feature options include VARP for the entire population, VARA for enabling non-numbers, and VARPA for both).
The offset part says to start at cell A1, move 0 columns and zero columns down, and then select a range that is B1 columns one column high and wide.
+1
a source to share