Skip to main content

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

Author: Sun Last Modified: 2025-05-12

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

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功能!立即下載!

相關文章:

最佳辦公效率工具

🤖 Kutools AI 助手:基於智能執行方式革新數據分析:智能執行   |  生成代碼  |  創建自訂公式  |  分析數據並生成圖表  |  調用 Kutools 函數
熱門功能查找、標記重複值或識別重複項   |  刪除空行   |  合併列或單元格而不丟失數據   |   四捨五入無需公式 ...
高級 LOOKUP多條件 VLookup    多值 VLookup  |   多表查找   |   模糊查找 ....
高級下拉列表快速創建下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
列管理器添加特定數量的列  |  移動列  |  切換隱藏列的可見狀態  |  比較區域和列 ...
特色功能網格聚焦   |  設計檢視   |   增強編輯欄    工作簿與工作表管理器   |  資源庫(自動文本)   |  日期提取器   |  合併資料   |  加密/解密儲存格    按列表發送電子郵件   |  超級篩選   |   特殊篩選(篩選粗體/斜體/刪除線...) ...
頂級 15 種工具集12 個文本工具添加文本刪除特定字符、...)   |   50+ 圖表 類型甘特圖、...)   |   40+ 實用 公式基於生日計算年齡、...)   |   19 個插入工具插入QR碼根據路徑插入圖片、...)   |   12 個轉換工具金額轉大寫匯率轉換、...)   |   7 個合併與分割工具高級合併行分割儲存格、...)   |   ... 還有更多

使用 Kutools for Excel 提升您的 Excel 技巧,體驗前所未有的高效。 Kutools for Excel 提供超過 300 種高級功能來提高生產力並節省時間。  點擊這裡獲取您最需要的功能...


Office Tab 將標籤式界面帶到 Office,讓您的工作更加輕鬆

  • 在 Word、Excel、PowerPoint、Publisher、Access、Visio 和 Project 中啟用標籤式編輯和閱讀。
  • 在同一窗口的新標籤中打開和創建多個文檔,而不是在新窗口中。
  • 將您的生產力提高 50%,每天為您減少數百次鼠標點擊!