跳到主要内容

在Excel中通过给定的一定均值和标准差生成随机数

在某些情况下,您可能希望根据给定的特定均值和标准差生成一系列随机数,如何快速解决此问题? 现在,本教程将介绍一种在Excel中处理它的方法。

通过给定的均值和标准差生成随机数


箭头蓝色右气泡 通过给定的均值和标准差生成随机数

要解决此问题,您需要执行以下步骤:

1.首先,您需要在两个空白单元格中键入所需的均值和标准差,在这里,我选择A1和A2。 看截图:doc-randomize-mean-stdv-1

2.然后在单元格B3中,键入此公式 = NORMINV(RAND(),$ B $ 1,$ B $ 2),然后将填充手柄拖到所需的范围。 看截图:doc-randomize-mean-stdv-2

Tips:: 在公式 = NORMINV(RAND(),$ B $ 1,$ B $ 2),$ B $ 1表示平均值,$ B $ 2表示标准偏差。

3.然后在单元格D1和D2中,您需要计算在步骤2中插入的随机数的平均值和标准偏差。在D1中,计算平均值,键入 =平均(B3:B16),按Enter键,然后在D2中计算标准偏差,输入 = STDEV.P(B3:B16) 并按下Enter键。

提示:在Excel 2007中,您需要输入公式 = STDEVP(B3:B16) 计算第一个随机数的标准差。

doc-randomize-mean-stdv-3
doc-randomize-mean-stdv-4

Tips::B3:B16是您在步骤2中对数字进行随机化的范围。

4.现在,您可以生成所需的真实随机数。 在单元格D3中,键入此公式 =$B$1+(B3-$D$1)*$B$2/$D$2,然后将填充手拖到所需的范围。 看截图:
doc-randomize-mean-stdv-5

Tips::B1表示所需的均值,B2表示所需的标准差,B3表示第一个随机数的第一个像元,D1是第一个随机数的均值,D2是第一个随机数的标准差。

您可以检查最终随机数序列的均值和标准差。

5.在单元格D17中,键入 = AVERAGR(D3:D16) 然后按Enter键,然后在单元格D18中键入 = STDEV.P(D3:D16) (或 = STDEVP(D3:D16) 在Excel 2007中),然后按 输入 键。
doc-randomize-mean-stdv-6

Tips::D3:D16是最后一个随机数序列的范围。


轻松插入随机数据,在一系列单元格中没有重复项

如果您想在一系列单元格中插入随机且没有重复的整数,日期,时间或字符串,甚至是自定义列表,那么论坛可能很难记住。 但 Kutools for Excel的插入器随机数据 可以尽快轻松地处理这些工作。 点击可使用全部功能30天免费试用!
doc插入随机数据
 
Kutools for Excel:拥有300多个便捷的Excel加载项,可以在30天内免费试用。

相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Sizin yapacağınız çeviriyi miksinler....
This comment was minimized by the moderator on the site
Muy útil, muchas gracias.
This comment was minimized by the moderator on the site
Super helpful! Can you please explain how you get the formula for the Final Random numbers please?
This comment was minimized by the moderator on the site
So why do you use the NORMINV function instead of the NORM.DIST function? What benefit does having the inverse of a distribution over
This comment was minimized by the moderator on the site
Is there a way to insert upper and lower limits to this formula?
This comment was minimized by the moderator on the site
Kewl. I used this to simulate market returns. However, I should mention that Mean is not the same as CAGR; i.e. I had to adjust the Mean higher to obtain my desired return.
This comment was minimized by the moderator on the site
Thank you soooo much, I've looking for this all day. Extremely helpful !
This comment was minimized by the moderator on the site
Amazing! Thanks for this post. It works!
This comment was minimized by the moderator on the site
this is really helpful, but i have a problem with negative value. what should i do?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations