跳到主要内容

如何在Excel中随机选择单元格?

假设您在工作表中有一列值(A1:A15),现在您需要从中选择5个随机单元格,如何处理呢? 在本文中,我将向您展示一些在Excel中随机选择单元格的技巧。

从具有公式的列中随机选择单元格

从具有用户定义函数(UDF)的列中随机选择单元格

使用 Kutools for Excel 从范围中随机选择单元格 好主意3


箭头蓝色右气泡 从具有公式的列中随机选择单元格

如以下屏幕截图所示,您拥有从A1到A15的一系列数据, 边界Index 公式可以帮助您在新列中显示随机单元格。 请执行以下操作:

文档选择单元格随机1

1.在相邻的单元格(例如B1)中,输入公式 = RAND(), 然后按 输入 键,然后将公式复制到单元格B15。 随机值将用单元格填充。 看截图:
文档选择单元格随机2

2.然后在下一个单元格(在本例中为C1单元格)中,输入公式 =INDEX($A$1:$A$15,RANK(B1,$B$1:$B$15)).
文档选择单元格随机3

3.然后按 输入 键,然后选择单元格C1,拖动填充手柄以覆盖所需选择的单元格。 并且在列C中显示了范围为A5:A1的15个随机单元。请参见屏幕截图:
文档选择单元格随机4


从Excel中的选择快速随机排序或选择单元格/行/列

Kutools for Excel 随机排序范围 可以快速按单元格,列或行对数据进行随机排序或选择。 点击获取全功能 30 天免费试用!
doc随机排序
doc随机选择
 
 Kutools for Excel:拥有300多个便捷的Excel加载项,可以在30天内免费试用。

箭头蓝色右气泡 从具有用户定义函数(UDF)的列中随机选择单元格

以下VBA代码还可以帮助您显示所需的随机单元格。

1。 点击 开发商 > Visual Basic中,一个新的 适用于应用程序的Microsoft Visual Basic 将显示一个窗口,单击 插页 > 模块,然后将以下功能输入到 模块:

Function RandomSelection(aRng As Range)
'Update20131113
Dim index As Integer
Randomize
index = Int(aRng.Count * Rnd + 1)
RandomSelection = aRng.Cells(index).Value
End Function

2.然后关闭模块窗口,并输入此功能 = RandomSelection($ A $ 1:$ A $ 15) 在单元格B1中。 看截图:
文档选择单元格随机5

3。 按 输入 键,并且B列中已显示A1:A15的随机值。然后拖动填充手柄以覆盖所需选择的单元格。文档选择单元格随机6

上述两种方法可以在新列中显示随机单元格值,并且它们仅适用于单个列范围,不适用于单元格范围。 Kutools for Excel 随机排序范围工具可以帮助您方便地在原始范围内随机选择单元格。


箭头蓝色右气泡 使用 Kutools for Excel 从范围中随机选择单元格

Kutools for Excel, 与超过 300 方便的功能,使您的工作更加轻松。 

免费安装 Kutools for Excel,请执行以下操作:

1.选择要使用的范围。

2.单击以应用该实用程序 库工具 > 范围 > 随机排序/选择范围,请参见屏幕截图:
doc随机选择1

3.在 随机排序/选择范围 对话框,单击 选择 按钮,然后输入您要选择的单元格的数量,然后选中 选择类型 你需要。 然后点击 OK or 应用。 看截图:

从所选范围中随机选择10个单元格
doc随机选择2

从所选范围中随机选择5行
doc随机选择3

从所选范围中随机选择4列
doc随机选择4

进阶选择随机储存格, 随机排序范围 of Kutools for Excel 可以在整个范围,每一行,每一列等中对数据进行随机排序。
doc随机选择5

箭头蓝色右气泡 随机选择或排序范围内的数据


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

如果您想在一系列单元格中插入随机且没有重复的整数,日期,时间或字符串,甚至是自定义列表,那么论坛可能很难记住。 但 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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Как же я намучился, пока подбирал эту же формулу для русскоязычного Excel! Вот она: =ИНДЕКС(A:A;РАНГ(B1;B:B;1))
This comment was minimized by the moderator on the site
Very useful, but the format of the cells has been changed and also its showing few duplicate values. Please tell me how to get it solved.
This comment was minimized by the moderator on the site
Hi I am looking to build a grid with names on the left and dates (weeks) across the top. I then need to have a function that fills in random X's on particular weeks for all names. Is this possible
This comment was minimized by the moderator on the site
This one is just awesome! Exactly what I needed! Thanks!
This comment was minimized by the moderator on the site
How to select perecent of cells randomly and replace by a specific number?
This comment was minimized by the moderator on the site
Thanks. Was a great and quick help.
This comment was minimized by the moderator on the site
Thanks. Really was a great and quick help.
This comment was minimized by the moderator on the site
Wow!!! This is really amazing! Thanks a lot for these great tricks.
This comment was minimized by the moderator on the site
Great info, however on my "randomly selected cells" there are duplicates... how can I prevent that from happening? I need the random selection to return unique cells
This comment was minimized by the moderator on the site
to do this you will need to set up a random non repeating set of numbers I used this website to do it: http://support.microsoft.com/kb/213290
This comment was minimized by the moderator on the site
I would like to random select a document with 500 items. I want to select 10 percent. There are four columns in that document. Is there a way to do this?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations