Skip to main content

如何在Excel中生成唯一的組合?

Author: Sun Last Modified: 2025-08-06

假設您有三個列表,現在您想從這三個列表中生成唯一的組合作為以下截圖所示,那麼您如何快速解決這個麻煩的問題呢?

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列,然後在編輯欄(F)中輸入此公式 =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列,並在編輯欄(F)中輸入 =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,並在編輯欄(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列,並在編輯欄(F)中輸入此公式 =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功能!立即下載!

相關文章:

最佳 Office 辦公效率工具

🤖 Kutools AI Aide:徹底革新數據分析,基於智能執行|生成程式碼|創建自訂公式|分析數據並生成圖表|調用 Kutools Functions
熱門功能查找、選取項目的背景色或標記重複值 | 刪除空行 | 合併列或單元格且不丟失資料 | 四捨五入...
高級 LOOKUP多條件查找|多值查找|多表查找|模糊查找...
高級下拉列表快速創建下拉列表 | 關聯下拉列表 | 多選下拉列表 ...
列管理器添加指定數量的列 | 移動列 | 切換隱藏列的可見狀態 | 區域與列比較 ...
精選功能網格聚焦 | 設計檢視 | 增強編輯欄 | 工作簿及工作表管理器 | 資源庫 (自動文本) | 日期提取器 | 合併資料 | 加密/解密儲存格 | 按清單發送電子郵件 | 超級篩選 | 特殊篩選(篩選粗體/傾斜/刪除線 ...)...
前15 大工具集12 款文本工具添加文本刪除特定字符,...)|50+ 種圖表 類型甘特圖,...)|40+ 實用 公式基於生日計算年齡,...)|19 款插入工具插入QR码按路徑插入圖片,...)|12 款轉換工具金額轉大寫匯率轉換,...)|7 款合併和分割工具高級合併行分割儲存格,...)| ...以及更多
使用 Kutools 支援你的語言——支援英語、西班牙語、德語、法語、中文及40 多種語言!

利用 Kutools for Excel 大幅提升你的 Excel 技能,感受前所未有的高效體驗。 Kutools for Excel 提供超過300 項高級功能,助你提升效率並保存時間。 點此查看你最需要的功能...


Office Tab 為 Office 帶來標籤式介面,讓你的工作更加輕鬆

  • 啟用 Word、Excel、PowerPoint 的標籤式編輯和閱讀功能
  • 在同一個視窗的標籤中打開和創建多個文件,而不是在新窗口中分開開啟。
  • 可提升你50% 的工作效率,每天為你大量減少滑鼠點擊次數!