How to write STDev formula in a macro

  • Thread starter Thread starter Chua
  • Start date Start date
C

Chua

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
 
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?
 
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
 
Hi,

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

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

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top