随机正常分布

时间:2015-08-04 12:46:00

标签: excel csv random normal-distribution visual-studio-macros

我有一个csv文件,看起来像:

subjects,       WeightedAverage,     WeightedStandardDev,    NumberofExams,
MathMark,              1.5,                 0.2,                   5,
PhysicMark,            1.6,                 0.4,                  10,
EnglishMark,            3,                  1.2,                  8,
PhiloMark,             8.2,                 1.5,                  9,
Others                 9.2,                 3.2,                  5,   

我有另一个文件,我需要为上面的每个主题以这种方式生成数据:

例如,对于主题MathMark,相应的表应为:

 NumberofExams                                     Mark                                                                              1                         =NORMINV(RAND(),WeightedAverage=1.5,WeightedStandardDev=0.2)
2                         =NORMINV(RAND(),WeightedAverage=1.5,WeightedStandardDev=0.2)
3                         =NORMINV(RAND(),WeightedAverage=1.5,WeightedStandardDev=0.2)
4                         =NORMINV(RAND(),WeightedAverage=1.5,WeightedStandardDev=0.2)
5                         =NORMINV(RAND(),WeightedAverage=1.5,WeightedStandardDev=0.2)

例如对于主题EnglishMark,相应的表应该是:

NumberofExams                                   Mark                                                                                            
1                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)                                                2                           =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)                                              3                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)                               
4                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)                                  
5                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)             
6                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)   
7                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)
8                          =NORMINV(RAND(),WeightedAverage=3,WeightedStandardDev=1.2)

想要生成NumberofExams正态分布的随机数(WeightedAverageWeightedStandardDev)。如何从另一个csv文件中获取这些信息并计算Excel中所需的随机数。任何公式或宏都表示赞赏。

0 个答案:

没有答案