RE: Absolute value of Normal distribution function (H(x)) using Excel
- From: Gary''s Student <GarysStudent@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Mar 2008 02:59:00 -0700
Hi Hard work:
How about:
Sub Macro12()
For N = 1 To 100
s = "NORMINV(RAND(),R[-4]C,R[-4]C[4])"
ActiveCell.FormulaR1C1 = "=ABS(" & s & ")"
Range("A5").Select
Selection.AutoFill Destination:=Range("A5:C5"), Type:=xlFillDefault
Range("A5:C5").Select
Selection.AutoFill Destination:=Range("A5:C7"), Type:=xlFillDefault
Range("A5:C7").Select
Calculate
Next N
End
End Sub
--
Gary''s Student - gsnu200773
"Hard work and determination always wins" wrote:
Hi all,.
I am new to this group and I want your help in clearing one of my queries in
evaluating Normal distribution value H(x) for multiple cells using Microsoft
excel VBA.
H(x) = NORMINV(RAND(),u(x),standard deviation(p(x) ).
The code that I am using up for generating H(x) in multiple cells for
multiple iterations is written below. Actually while
executing the code for multiple iterations I am getting negative values of
H(x) in some of the cells. I want to get the absolute values in all the
cells.
Sub Macro12()
For N = 1 To 100
ActiveCell.FormulaR1C1 = "=NORMINV(RAND(),R[-4]C,R[-4]C[4])"
Range("A5").Select
Selection.AutoFill Destination:=Range("A5:C5"), Type:=xlFillDefault
Range("A5:C5").Select
Selection.AutoFill Destination:=Range("A5:C7"), Type:=xlFillDefault
Range("A5:C7").Select
Calculate
Next N
End
End Sub
After executing the above code the values of H(x) that i am getting in
mutiple cells in excel is:
11.43882 21.64152 -0.3367
39.54251 19.52808 4.830327
19.66224 19.8019 7.046292
Please have a look and let me know how to get the absolute values of H(x) in
all the cells (no negative values). Do we need to modify my code to remove
the negative signs. Thanks for the help.
Thanks and Regards,
Subrat Kumar Swain.
- Prev by Date: Re: copy full screen PowerPoint slideshow image and paste into MS Word through vba code
- Next by Date: Set Printing Preference (single/Double sided) with Macro
- Previous by thread: How best to distribute Excel 2003 spread*** with VBA Macros?
- Next by thread: Set Printing Preference (single/Double sided) with Macro
- Index(es):