In this guide, we're going to show you how to find all combinations of two lists in Excel by using Power Query.

Download Workbook

In our example, we have two lists that contain Pokémon names and we want to see the combinations of matched Pokémon.

We can join these two tables to compare them by using Get & Transform Data. Get & Transform Data feature consists of tools, previously known as Power Query. You can get more information about this here: Power Query 101.

Creating queries from tables

First step is to convert the tables into Power Query structure.

  1. Select one of your tables.
  2. Open the Data tab and click the corresponding icon under the Get & Transform Data section to get data from your workbook.
    1. (Microsoft 365 / Excel 2019) From Sheet

    2. (Excel 2016) From Table/Range
    3. (Excel 2010 / Excel 2013) Use Power Pivot tab instead of Data
  3. Clicking the button opens the Power Query Editor.
  4. Once you are done with the changes, click Custom Column in Add Column. We will add a helper column which will be a common point between the two tables.
  5. Enter a friendly name for your new column and enter =1 into the formula section.
    How to find all combinations of two lists in Excel 05
  6. Click OK to save.
  7. After adding the helper column, return to the Home tab and click Close & Load To item in Close & Load list to see options.
  8. Make sure to select Only Create Connection in the Import Data This option will save the table as a connection rather that populating the queried data in the worksheet.
  9. Apply the same steps to the other table. At the end you should have two queries corresponding with your tables. You can see these tables in Queries & Connections pane in Excel.

Joining queries to find all combinations of two lists

Next step is to join (merge) the queries on a new table which will allow us to see any differences between the tables.

  1. Once the queries from the tables are ready, go to Data > Get Data > Combine Queries > Merge to open the Merge dialog of Power Query.
  2. Select each table in the drop downs.
  3. Click on the column for each table to select them.
  4. Finally select Full Outer option for Join Kind to join by all rows from both tables.
  5. Click OK to apply selections.
    How to find all combinations of two lists in Excel 09
  6. You will see three columns after merging. The first one is the items of the first list. Right-click on the column in the middle and select Remove to delete the helper column.
  7. Click the button next to the column title.
  8. Make sure that the Expand option is selected in the popup menu.
  9. Uncheck the helper column.
  10. Uncheck Use original column as prefix.
  11. Click OK to populate the data of the second table.
  12. You will see the combinations in Power Query. When you are OK with the outcome, click Close & Load, this time to populate the entire data into your worksheet.
    How to find all combinations of two lists in Excel 12-min

After populating the merged table, you can see all combinations of the two lists.

How to find all combinations of two lists in Excel