Function Problems

How to Remove Duplicate Names in Excel TEXTJOIN Formula

John WilsonJohn Wilson Nov 11, 2026 868 views

Question details

The user needs to combine multiple names (such as modifier, creator, and owner) into a single cell without repeating the same name if a person fulfills multiple roles.

How to Remove Duplicate Names from an Excel TEXTJOIN Formula
Product
Excel
Device & OS
not provided
Scenario
Combining data from multiple columns or complex lookups into a single comma-separated or semicolon-separated text string.
Observed behavior
Standard TEXTJOIN includes all returned values, resulting in duplicate names in the final text string. The goal is to output only unique names.
Before you start

Ensure you are using a version of Excel or WPS Spreadsheet that supports dynamic array functions like UNIQUE and VSTACK (e.g., Microsoft 365, Excel 2021, or the latest WPS Office).

Solution 1Recommended

Combine TEXTJOIN, UNIQUE, and VSTACK Functions

This is the most efficient method to stack multiple values, filter out duplicates, and join them into a single text string.

The VSTACK function allows you to stack multiple arrays or lookups vertically. By wrapping this in the UNIQUE function, you instantly filter out any duplicate names. Finally, TEXTJOIN combines the unique array into a single cell with your chosen delimiter.

1
Select the target cell

Click on the cell where you want the combined, deduplicated names to appear.

2
Start the TEXTJOIN function

Type =TEXTJOIN("; ", TRUE, to start the formula. This specifies a semicolon and space as the delimiter, and TRUE tells the formula to ignore empty cells.

3
Add the UNIQUE function

Type UNIQUE( immediately after the comma to ensure only distinct values are returned.

4
Stack your data with VSTACK

Use VSTACK( to combine your different data sources or lookups. For example, VSTACK(A2, B2, C2) or your specific XLOOKUP formulas.

5
Complete the formula

Close all parentheses and press Enter. A basic example looks like: =TEXTJOIN("; ", TRUE, UNIQUE(VSTACK(A2, B2, C2))).

Dynamic Updates: Because this formula uses dynamic arrays, the result will automatically update if the source names change or if new duplicates are introduced.
Advanced Formulas in WPS Spreadsheet

Use Dynamic Array Functions in WPS Office

WPS Spreadsheet fully supports advanced dynamic array functions like TEXTJOIN, UNIQUE, and VSTACK, allowing you to clean and combine data effortlessly.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data.
  2. 2. Select the output cell: Click the cell where you want the combined names to be displayed.
  3. 3. Enter the formula: Type the =TEXTJOIN(", ", TRUE, UNIQUE(VSTACK(...))) formula using your specific cell references.
  4. 4. Apply the formula: Press Enter to instantly view the deduplicated, combined text string.
Fully compatible with Microsoft Excel formulas and dynamic arraysLightweight and fast processing for large datasetsFree to use with a familiar, intuitive interfaceBuilt-in data cleaning and deduplication tools
microsoft office alternative - wps office

Frequently Asked Questions

Why is the UNIQUE function returning a #NAME? error?

The #NAME? error usually occurs if you are using an older version of Excel (like Excel 2016 or 2019) that does not support dynamic array functions. You will need to upgrade to Microsoft 365, Excel 2021, or use a modern alternative like WPS Office.

Can I use a comma instead of a semicolon in TEXTJOIN?

Yes, the first argument in the TEXTJOIN function is the delimiter. You can change "; " to ", " or any other character you prefer to separate the names.

How do I ignore blank cells in my TEXTJOIN formula?

Set the second argument of the TEXTJOIN function to TRUE. This tells the formula to ignore any empty strings returned by your lookups or cell references, preventing extra delimiters in your final text.

What if I don't have the VSTACK function available?

If VSTACK is not available, you can use a contiguous range like UNIQUE(A2:C2) if your data is side-by-side. For non-contiguous data in older versions, you may need to use Power Query to unpivot and remove duplicates before joining the text.