Forum Discussion

SP3990's avatar
SP3990
Brass Contributor
Apr 11, 2026
Solved

combine multiple text into single line of text

Hi is there a way to combine all the cells into a single cell (of text) ignoring the duplicates/repeat values. i know concatenate but that function becomes very lengthy as ill have to define every ce...
  • Olufemi7's avatar
    Apr 11, 2026

    Hello SP3990​,
    If you are using Excel 365 or Excel 2021, use:

    =TEXTJOIN(", ", TRUE, UNIQUE(A1:C10))

    Replace A1:C10 with your actual range.

    Explanation:
    TEXTJOIN combines all values into one cell using a delimiter (", " in this case).
    UNIQUE removes duplicate values from the selected range.
    TRUE tells Excel to ignore empty cells.

    Optional enhancements:

    To sort the result:
    =TEXTJOIN(", ", TRUE, SORT(UNIQUE(A1:C10)))

    To use a line break instead of a comma:
    =TEXTJOIN(CHAR(10), TRUE, UNIQUE(A1:C10))
    (then enable Wrap Text)

    Note:
    UNIQUE treats numbers and text differently. For example, 123 and "123" may be considered different values. If your data has mixed types, you may want to standardize them first.

    If you are on an older Excel version without UNIQUE or TEXTJOIN, the best alternative is to use Power Query to remove duplicates and combine values.