跳至主要内容

如何在Excel中生成唯一组合?

Author: Sun Last Modified: 2025-05-07

假设您有三个列表,现在您想从这三个列表中生成唯一组合作为下面的截图所示,那么您如何快速解决这个麻烦的问题呢?

A screenshot showing three lists in Excel from which unique combinations will be generatedArrowA screenshot showing the result of generating unique combinations from three lists in Excel

使用多个公式生成唯一组合

通过Kutools for Excel生成唯一组合good idea3


使用多个公式生成唯一组合

1. 在三个列表旁边选择一个空白列,例如D列,并在编辑栏中输入此公式 =MOD((ROW()-1),4)+1,然后按 Ctrl + Enter 键将此公式应用到整个列。请参见截图:

A screenshot showing the first formula being applied in Excel to generate unique combinations
Arrow
A screenshot showing the application of the first formula in generating unique combinations in Excel

2. 然后选择第一个公式列D旁边的整个E列,并在编辑栏中输入 =MOD(INT((ROW()-1)/4),4)+1,然后按 Ctrl + Enter 键应用该公式。请参见截图:

A screenshot showing the second formula being applied to generate unique combinations in Excel
Arrow
A screenshot showing the second formula applied in the column to generate unique combinations

3. 移动到第二个公式列E旁边的第三个新列F,并在编辑栏中输入此公式 =MOD(INT(INT((ROW()-1)/4)/4),4)+1,然后按 Ctrl + Enter 键将公式应用到整个列。请参见截图:

A screenshot showing the third formula applied in Excel to generate unique combinations
Arrow
A screenshot showing the third formula applied to generate unique combinations in Excel

4. 继续选择G列,并在编辑栏中输入此公式 =INDEX(A$1:A$4,D1),然后按 Ctrl + Enter 键获取结果。请参见截图:

提示:A1是第一个列表的第一个单元格,D1是包含第一个公式的列的第一个单元格。

A screenshot showing the INDEX formula applied in Excel to generate unique combinations
Arrow
A screenshot showing the result of the INDEX formula in generating unique combinations

5. 单击G1,然后向右拖动自动填充柄至I1,然后分别选择H列和I列以将公式应用到整个列。请参见截图:

A screenshot showing the step to click on G1 and drag the autofill handle right to I1 in Excel
Arrow
A screenshot showing the step to separately select column H and column I to apply the formula to the entire columns in Excel

然后您可以合并G列、H列和I列。

6. 选择J1,然后输入此公式 =G1&H1&I1,按 Enter 键,然后向下拖动自动填充柄直到出现重复项。请参见截图:

提示:G1、H1和I1是包含公式的单元格。

A screenshot showing the concatenation formula applied to generate final unique combinations
Arrow
A screenshot showing the final unique combinations generated from three lists in Excel

现在所有唯一组合都已由三个列表生成。

注意:在公式 =MOD((ROW()-1),4)+1=MOD(INT((ROW()-1)/4),4)+1 和 =MOD(INT(INT((ROW()-1)/4)/4),4)+1 中,4表示列表中有4个数据。


通过Kutools for Excel生成唯一组合

使用上述方法,对于用户来说太复杂和麻烦了,幸运的是,Kutools for Excel列出所有组合功能可以快速通过三个列表生成唯一的可能组合。

Kutools for Excel 提供了超过 300 种高级功能,简化复杂任务,提升创造力与效率。 通过集成 AI 能力,Kutools 能够精准自动执行任务,让数据管理变得轻松简单。Kutools for Excel 的详细信息...         免费试用...

1. 单击 Kutools > 插入 > 列出所有组合。请参见截图:

A screenshot of the List All Combinations option under the Kutools tab in Excel

2. 然后在 “列出所有组合”对话框中,从 “类型”下拉列表中选择“值”,单击“浏览”按钮选择第一个列表,并单击“添加”将其添加到组合列表中。请参见截图:

A screenshot of the List All Combinations dialog

重复此操作以将所有列表依次添加到组合列表部分。请参见截图:

A screenshot showing all lists added to the Combinations List

3. 单击确定,并在弹出的对话框中选择目标范围的第一个单元格以输出组合。请参见截图:

A screenshot showing the dialog for selecting a destination range for the unique combinations

4. 单击确定,所有唯一组合已经生成。

A screenshot showing the final output of unique combinations in Excel

Kutools for Excel - 通过超过300个必备工具,让Excel功能大幅提升。永久免费享受AI功能!立即获取

演示:在Excel中列出所有可能的唯一组合

Kutools for Excel:超过 300 种实用工具触手可及!永久免费享受 AI 功能!立即下载!

相关文章:

最佳办公效率工具

🤖 Kutools AI 助手:基于智能执行生成代码创建自定义公式分析数据并生成图表调用 Kutools 函数等功能,彻底改变数据分析方式…
热门功能查找、高亮或标记重复项 | 删除空行 | 合并不丢失数据的列或单元格 | 四舍五入 ...
高级 LOOKUP多条件 VLookup | 多值 VLookup | 多表查找 | 模糊查找 ....
高级下拉列表快速创建下拉列表 | 从属下拉列表 | 多选下拉列表 ....
列管理器添加指定数量的列 | 移动列 | 切换隐藏列的可见状态 | 比较区域和列 ...
精选功能网格聚焦 | 设计视图 | 增强编辑栏 | 工作簿与工作表管理器 | 资源库(自动文本) | 日期提取 | 合并数据 | 加密/解密单元格 | 按列表发送电子邮件 | 超级筛选 | 特殊筛选(筛选粗体/斜体/删除线...)...
排名前 15 的工具集12 种文本 工具添加文本删除特定字符等) | 50 多 种图表 类型甘特图等) | 40 多种实用 公式基于生日计算年龄等) | 19 种插入 工具插入二维码根据路径插入图片等) | 12 种转换 工具小写金额转大写汇率转换等) | 7 种合并与分割 工具高级合并行分割单元格等) | 还有更多...

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


Office Tab 将标签式界面引入 Office,让您的工作更加轻松

  • 在 Word、Excel、PowerPoint 中启用标签式编辑和阅读
  • 在同一窗口的新标签页中打开和创建多个文档,而不是在新窗口中进行操作。
  • 将您的生产力提升 50%,每天为您减少数百次鼠标点击!