单元格范围内的随机单元格 - Excel [英] Random cell in a range of cells - Excel

查看:232
本文介绍了单元格范围内的随机单元格 - Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Excel中实现一个Montecarlo方法。我需要从A1到P4的单元格范围内选择一个随机单元格,因为在这个单元格范围内,我有我需要的数字。

i'm trying to implement a Montecarlo method in Excel. I need to select a random cell BUT from a range of cells like from A1 to P4 because inside this range of cells i have the numbers i need.

非常感谢你

推荐答案

我将这样做的方式是在两列中使用RAND()函数(一行用于行,一列用于列)

The way I would do this is to use the RAND() function in two columns (one for rows, one for columns).

使用您需要的单元格,在第一列中说R2:R5,放在RAND()中。在S2:S16中(或者说A到P中的多个单元格是..),请执行相同的操作。

Using the cells you need, in the first column say R2:R5, place in RAND(). In S2:S16 (or however many cells across A to P is..), do the same.

在单元格S1和R1中,使用RANK函数对R2和S2中的单元基于它们各自的列。然后,使用INDEX函数返回行和列中的特定值。

In cells S1 and R1, use the RANK function to rank the cells in R2 and S2 based on their respective columns. Then, use the INDEX function to return the specific value in the row and column.

请注意,RAND函数将自动重新计算。如果您只想这样做一次,请复制并粘贴特殊值,否则结果将会更改。

Beware, the RAND function will recalculate automatically. If you only want to do this once, copy and paste special- values, else the results will change.

这篇关于单元格范围内的随机单元格 - Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆