بحثت عن دالة الانحراف المعياري فوجدت هذا الكود الذي يعمل مع الاكسل
وطلبي تعديل الكود ليعمل في الفيجول
والكود هو
Function Rounded_Stdev(x_values As Variant) As Double
'Dimension memory for variables
Dim n As Integer
Dim sum_of_x As Double, sum_of_x_squared As Double
'Initialize variables before For Each loop
sum_of_x = 0
sum_of_x_squared = 0
'calculates count of x_values
n = x_values.Count
For Each cell In x_values
sum_of_x = sum_of_x + cell.Value
sum_of_x_squared = sum_of_x_squared + cell.Value ^ 2
Next
'Perform math necessary to calculate standard deviation.
Rounded_Stdev = n * sum_of_x_squared - sum_of_x ^ 2
'Round at this step to remove any possible mathematical discrepancies.
Rounded_Stdev = Application.Round(Rounded_Stdev, 14)
'Continue to perform math necessary to calculate standard deviation.
Rounded_Stdev = Rounded_Stdev / (n * (n - 1))
Rounded_Stdev = Rounded_Stdev ^ 0.5
End Function
الرجاء المساعدة..............تحياتي وكل عام وانتم بخير
