Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Creating macro for slightly complicated formula
I'm really new to the whole macro business so I really need help. I'm trying
to create a macro to solve this equation D =(Sum from 1 to Nt ((X - Xmean)^2/Nt))^0.5 ......I hope it's clear. I don't know hope to format here. Anyway, I have a range of Xs that are Nt in number and Nt is unknown so it will have to be found first and this has to be in the code. I'm trying to avoid having another column containing the values of (X - Xt)^2/Nt. I just want D to be displayed in a designated cell, like F2. This code will be used for multiple workbooks, all the data always on sheet 1 and Nt always a different value. All the ways I could think of involved having the extra column. I would really appreciate any help. All I have so far is Sub Macro2() Dim LR As Long Dim Mean Dim Total Dim i As Long LR = .Range("A" & .Rows.Count).End(xlUp).Row Mean = Average("A2:LR") Total = 0 For i = 2 To LR and I don't even understand the principle behind the LR code. Thank you and sorry if I was long winded. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Creating macro for slightly complicated formula
Hello,
Why do you want to code this? There are built-in worksheet functions to calculate the standard deviation in Excel, for example STDEV and STDEVP. See the Excel help on those for more details. But if you still need to do it on your own, http://sulprobil.com/html/statistics...ed_values.html might give you a hint (look at the STDEV part of the macro - your question would be answered if all weights are set to 1). Regards, Bernd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A slightly complicated finance problem | Excel Discussion (Misc queries) | |||
Creating formula or macro | Excel Worksheet Functions | |||
Complicated formula or macro | Excel Discussion (Misc queries) | |||
Creating Complicated Charting | Charts and Charting in Excel | |||
Creating a complicated formula | Excel Worksheet Functions |