ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to write STDev formula in a macro (https://www.excelbanter.com/excel-programming/415836-how-write-stdev-formula-macro.html)

Chua

How to write STDev formula in a macro
 
I have a list of data over 600 points to calculate the STDev.

Eg. Range A1:IR252 and Range A9:IR252

Anyone has idea how to write a macro to detect the different rows of values
and calculate the STDev using VBA?

Thanks

Bob Bridges

How to write STDev formula in a macro
 
Seems to me the very simplest way would be to use
Application.WorksheetFunctions.StDev. If you do that, you can supply a
range... Oh, I see; it accepts only 30 values. I guess you'll have to run
through a loop doing the standard-deviation calculation.

So is it a loop that you're not sure how to write, or is it the standard
deviation itself? It seems to me it must be something about VBA macros,
because anyone who wants to use a standard deviation probably already knows
how to obtain it, right?

If so, what part of VBA macros are you unsure of? Have you ever written a
program at all? Ever written anything at all in VBA? I mean, where are we
starting?

--- "Chua" wrote:
I have a list of data over 600 points to calculate the STDev.

Eg. Range A1:IR252 and Range A9:IR252

Anyone has idea how to write a macro to detect the different rows of values
and calculate the STDev using VBA?


Chua

How to write STDev formula in a macro
 
As you mentioned, it can only accept 30 values.......I have no problem
writing the loop....just want to check what is the formula for STDev.

Thanks

"Bob Bridges" wrote:

Seems to me the very simplest way would be to use
Application.WorksheetFunctions.StDev. If you do that, you can supply a
range... Oh, I see; it accepts only 30 values. I guess you'll have to run
through a loop doing the standard-deviation calculation.

So is it a loop that you're not sure how to write, or is it the standard
deviation itself? It seems to me it must be something about VBA macros,
because anyone who wants to use a standard deviation probably already knows
how to obtain it, right?

If so, what part of VBA macros are you unsure of? Have you ever written a
program at all? Ever written anything at all in VBA? I mean, where are we
starting?

--- "Chua" wrote:
I have a list of data over 600 points to calculate the STDev.

Eg. Range A1:IR252 and Range A9:IR252

Anyone has idea how to write a macro to detect the different rows of values
and calculate the STDev using VBA?


Mike H

How to write STDev formula in a macro
 
Hi,

It doesn't accept 30 values, it accepts 30 arguments so

=stdev(a1:a1000) is 1 argument and not 1000

Mike

"Chua" wrote:

As you mentioned, it can only accept 30 values.......I have no problem
writing the loop....just want to check what is the formula for STDev.

Thanks

"Bob Bridges" wrote:

Seems to me the very simplest way would be to use
Application.WorksheetFunctions.StDev. If you do that, you can supply a
range... Oh, I see; it accepts only 30 values. I guess you'll have to run
through a loop doing the standard-deviation calculation.

So is it a loop that you're not sure how to write, or is it the standard
deviation itself? It seems to me it must be something about VBA macros,
because anyone who wants to use a standard deviation probably already knows
how to obtain it, right?

If so, what part of VBA macros are you unsure of? Have you ever written a
program at all? Ever written anything at all in VBA? I mean, where are we
starting?

--- "Chua" wrote:
I have a list of data over 600 points to calculate the STDev.

Eg. Range A1:IR252 and Range A9:IR252

Anyone has idea how to write a macro to detect the different rows of values
and calculate the STDev using VBA?



All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com