Function Problems

How to Concatenate Unique Values Without Duplicates in Excel

Anum MushtaqAnum Mushtaq Oct 15, 2026 873 views

Question details

The user needs a formula to combine distinct values from a specified cell range into one single cell, filtering out duplicate entries and completely ignoring empty cells.

How to Concatenate Unique Values Without Duplicates in Excel
Product
Excel
Device & OS
not provided
Scenario
Consolidating data categories, creating summary reports, or cleaning up unorganized lists into a neat, single-cell text string.
Observed behavior
Distinct items from a given data range are successfully extracted and merged into a single text string separated by a designated delimiter.
Before you start

Ensure your spreadsheet software version supports dynamic array functions like UNIQUE (available in Microsoft 365, Excel 2021, and modern versions of WPS Office), as older versions will return an error.

Solution 1Recommended

Use the TEXTJOIN and UNIQUE Functions

This is the most efficient and recommended approach using modern dynamic array formulas to instantly extract and combine distinct values.

By nesting the UNIQUE function inside the TEXTJOIN function, you can automatically filter out duplicate values from an array before combining them. The TEXTJOIN function's built-in feature to ignore empty cells ensures a clean, perfectly formatted text string.

1
Select the target cell

Click on the specific cell where you want the final concatenated text string to be displayed.

2
Enter the nested formula

Type the formula: =TEXTJOIN(",", TRUE, UNIQUE(A1:A100)). Replace A1:A100 with the actual data range you want to evaluate.

3
Customize your delimiter

If you prefer a different separator instead of a comma, change the first argument in quotation marks. For example, use "; " or " | ".

4
Apply the formula

Press the Enter key. The cell will now display all unique, non-blank values from your selected range, separated by your chosen delimiter.

Use the TEXTJOIN and UNIQUE Functions
Ignoring Blank Cells: The 'TRUE' argument in the TEXTJOIN function automatically skips any blank cells in your selected range, preventing extra commas or awkward spacing in your final text string.
Efficient Data Processing

Easily Concatenate Unique Values with WPS Spreadsheet

WPS Spreadsheet fully supports advanced dynamic array functions like TEXTJOIN and UNIQUE out of the box. You can seamlessly process complex data, extract unique values, and combine them effortlessly without resorting to complex scripts.

  1. 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
  2. 2. Open your data file: Launch WPS Spreadsheet and open your existing workbook containing the data you want to consolidate.
  3. 3. Apply the modern formula: Select an empty cell and type =TEXTJOIN(",", TRUE, UNIQUE(YourDataRange)).
  4. 4. Get instant results: Press Enter to instantly view your comma-separated unique values without any duplicates.
Fully compatible with Microsoft Excel formulas, functions, and file formats (.xlsx).Natively supports modern dynamic array functions including UNIQUE, FILTER, and TEXTJOIN.Lightweight, fast, and runs smoothly even when calculating large datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula return a #NAME? error when using UNIQUE?

The #NAME? error typically appears if your current spreadsheet software version does not support dynamic array formulas like UNIQUE. Upgrading to a modern suite like Microsoft 365, Excel 2021, or the latest version of WPS Office will resolve this issue.

Can I separate the unique values with a line break instead of a comma?

Yes. Instead of a comma, use the CHAR(10) function as your delimiter. The formula will look like: =TEXTJOIN(CHAR(10), TRUE, UNIQUE(A1:A100)). Make sure to also enable 'Wrap Text' on the result cell so the line breaks display properly.

Is the UNIQUE function case-sensitive?

By default, the UNIQUE function is not case-sensitive. It will treat 'Apple' and 'apple' as the exact same text and only return the first instance it finds. To process case-sensitive duplicates, you would need a more advanced array formula using EXACT, or utilize Power Query.

How can I sort the concatenated unique values alphabetically?

You can add the SORT function into your formula nesting. Simply wrap the UNIQUE function inside SORT like this: =TEXTJOIN(",", TRUE, SORT(UNIQUE(A1:A100))). This ensures your final combined text string is alphabetized.