Create a Unique List from an Excel Query Table
Question details
Create a separate list containing one entry for each unique name in a query-loaded Excel table.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A database query loads a table with repeated names, and a separate summary needs one record per name.
- Observed behavior
- The desired result is a list of distinct names derived from the query table.
Confirm that the query results are loaded into an Excel table and identify the table and name-column headers. To check the table name, select a cell in the table and open the Table Design tab.
Use a dynamic array formula to list unique names
Use this method in an Excel version that supports UNIQUE and SORT when you want a sorted list that updates with the table.
Click an empty cell outside the query table, with enough blank cells below it for the results.
Enter =SORT(UNIQUE(Table1[Name])) and press Enter. Replace Table1 and Name with your actual table and column names.
Review the spilled list below the formula. Refresh the source query from Data > Refresh All when you need updated database results.
Create a PivotTable with one row per name
Use a PivotTable when you only need a distinct list or want to build a summary around each name.
Reference the source query and remove duplicate names
Use Power Query when the distinct list should be a separate query output.
List unique names with a WPS Spreadsheets PivotTable
Open your Excel workbook in WPS Spreadsheets and use a PivotTable to create a separate list with one row for each name.
- 1. Open the workbook: Open WPS Spreadsheets and choose Open to select the Excel workbook containing the source table.
- 2. Insert a PivotTable: Select a cell in the source table and choose Insert > PivotTable. Confirm the source range and choose a location for the PivotTable.
- 3. Add names to rows: In the PivotTable field list, drag the Name field to the Rows area to display each distinct name.
- 4. Refresh after changes: When the source table changes, right-click the PivotTable and select Refresh to update the list.

Frequently Asked Questions
Which Excel versions support the UNIQUE formula?
UNIQUE is available in Excel versions with dynamic arrays, including Microsoft 365 and Excel 2021 or later. In older versions, use Insert > PivotTable or Power Query to create the list.
Why does my unique list show a #SPILL! error?
The formula needs empty cells for its results. Clear the cells blocking the spill range and enter the formula outside the Excel table.
How do I update the list after the database changes?
Use Data > Refresh All to refresh the source query. A UNIQUE formula recalculates from the updated table; a PivotTable may also need a right-click and Refresh.
Can I remove duplicates by name while keeping other columns?
Yes. In Power Query Editor, select the Name column and choose Home > Remove Rows > Remove Duplicates. One row is retained for each name, but check whether its other column values are the ones you need.




