Combining Cell Ranges in Excel with a Comma Delimiter

📅 Oct 05, 2026 📝 Sarah Miller

Manually merging dispersed cell ranges in Excel is a tedious, error-prone struggle for analytical professionals. While traditional methods like manual ampersands serve as standard consolidation sources, they lack efficiency. Fortunately, the TEXTJOIN function grants users the power to seamlessly combine multiple ranges with a comma delimiter. As a stipulation, please note that this function requires Excel 2019 or Microsoft 365 to operate. For example, merging ranges A1:A3 and C1:C3 is now instantaneous. Below, we break down the exact formula syntax and configuration settings to master this time-saving technique.

Combining Cell Ranges in Excel with a Comma Delimiter

Excel Formula to Combine Cell Ranges Using a Comma Delimiter

In data management and analysis, there frequently arises a need to consolidate data from multiple cells into a single, cohesive string. Whether you are creating a distribution list of email addresses, generating a list of ID numbers for an SQL database query, or preparing a clean summary report, combining cell ranges with a comma; an essential Excel skill.

H; torically, Excel users had to rely on tedious formulas or complex VBA scripts to accompl; h th; . However, modern versions of Excel have introduced powerful functions that make th; process incredibly simple. In th; comprehensive guide, we will explore the best methods to combine cell ranges using a comma delimiter, ranging from the highly efficient TEXTJOIN function to legacy workarounds, conditional combinations, and advanced automated solutions.


Method 1: The Modern Standard – Using the TEXTJOIN Function

If you are using Excel 2019, Excel 365, or Excel for the Web, the absolute best tool for the job; the TEXTJOIN function. Unlike older concatenation functions, TEXTJOIN allows you to specify a; choose whether or not to ignore empty cells within your selected range.

The Syntax of TEXTJOIN

The syntax for the function is structured as follows:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)
  • delimiter: The character or string you want to insert between each text value. For a comma delimiter, you will use ", " (a comma followed by a space) enclosed in double quotation marks.
  • ignore_empty: A boolean value (TRUE or FALSE). If set to TRUE, Excel will skip blank cells in your range, preventing consecutive, redundant commas. If set to FALSE, Excel will include empty cells as blank values.
  • text1, text2, ...: The ranges, arrays, or individual cells containing the values you want to combine.

Step-by-Step Example

Imagine you have a list of names in the range A2:A10; you want to combine them into cell C2 separated by a comma; a space.

Enter the following formula into cell C2:

=TEXTJOIN(", ", TRUE, A2:A10)

Result: If your range contains "John", "Sarah", "",; "Michael", the output will be:
John, Sarah, Michael (note that the empty cell was completely ignored, avoiding a messy output like John, Sarah, , Michael).


Method 2: Combining Non-Adjacent Ranges with TEXTJOIN

One of the great advantages of TEXTJOIN is its ability to h; le multiple, disjointed cell ranges. You are not limited to a single continuous column or row.

For example, if you want to combine values from A2:A5; C2:C5 while skipping any blank spaces, you can simply list both ranges as separate arguments:

=TEXTJOIN(", ", TRUE, A2:A5, C2:C5)

Excel will seamlessly concatenate all active cells across both ranges into a single comma-separated string.


Method 3: Combining Unique Values Only

Often, your dataset will contain duplicate entries,; you only want to combine distinct, unique values. By nesting the UNIQUE function inside TEXTJOIN, you can create a unique, comma-delimited list instantly.

To extract only unique values from the range A2:A20, use this nested formula:

=TEXTJOIN(", ", TRUE, UNIQUE(A2:A20))

This is especially helpful when compiling lists of unique zip codes, department names, or product SKUs from transactional spreadsheets.


Method 4: Conditional Combinations using TEXTJOIN; FILTER

What if you only want to combine cells that meet specific criteria? For example, you may want to create a comma-separated list of "Project Managers" from a list of employees where their role is listed in column B.

By nesting the FILTER function inside TEXTJOIN, you can achieve this dynamically:

=TEXTJOIN(", ", TRUE, FILTER(A2:A15, B2:B15 = "Project Manager", ""))

In this formula:

  • FILTER(A2:A15, B2:B15 = "Project Manager", "") filters the list in column A, returning only the names where the corresponding value in column B is "Project Manager".
  • TEXTJOIN then takes that filtered array; joins them together using a comma.

Method 5: Legacy Support – Using CONCAT or CONCATENATE (Excel 2016; Earlier)

If you are working on an older version of Excel (such as Excel 2013 or 2016) that does not support the TEXTJOIN function, you will have to use alternative methods. The traditional CONCATENATE function (or CONCAT in Excel 2016) does not natively support delimiters or range selections with separators.

The Manual Concatenation Approach

If you only have a few cells, you can manually type them out using the ampers; (&) operator or the CONCATENATE function:

=A2 & ", " & A3 & ", " & A4 & ", " & A5

While this works for 3 or 4 cells, it quickly becomes unmanageable; highly prone to errors when dealing with dozens or hundreds of rows.

Using a Helper Column for Large Datasets in Older Excel Versions

To combine a large vertical range without TEXTJOIN, you can construct a running concatenation in a helper column:

  1. In cell B2 (next to your first data point), type:
    =A2
  2. In cell B3, enter the following formula:
    =B2 & ", " & A3
  3. Drag this formula down to the bottom of your dataset (e.g., cell B10).

The very last cell (B10) will now contain the fully concatenated list of all cells above it. You can copy this value; paste it as a plain text value wherever you need it.


Method 6: Formatting Data for Special Outputs (SQL; Mailings)

Data analysts frequently need to format Excel data to insert directly into an SQL database query's IN clause. This requires wrapping each cell's text in single quotes, separated by a comma.

You can easily format your TEXTJOIN formula to automatically add these single quotes:

="'" & TEXTJOIN("', '", TRUE, A2:A6) & "'"

How it works:

  • The; is changed to "', '" (single quote, comma, space, single quote).
  • The formula prepends a single quote at the very beginning ("'" &) and appends a single quote at the very end (& "'").

Result: If your cells contain Apple, Banana, and Cherry, the output will format perfectly for database use:
'Apple', 'Banana', 'Cherry'


Method 7: Creating a Custom VBA Function (For Ultimate Flexibility)

If you regularly work on older Excel installations or want a highly customizable solution, you can create a custom User Defined Function (UDF) using VBA (Visual Basic for Applications). This replicates the TEXTJOIN function across any Excel workbook.

VBA Code for Custom Concatenation

Follow these steps to add the function:

  1. Press ALT + F11 to open the VBA Editor.
  2. Click Insert > Module.
  3. Copy and paste the following code into the empty module window:
Function CustomJoin(SelectedRange As Range,;
String);
String
    Dim Cell;
Range
    Dim Result;
String
    
    For Each Cell In SelectedRange
        If Cell.Value <> "" Then
            Result = Result & Cell.Value & Delimiter
        End If
    Next Cell
    
    ' Remove the trailing delimiter
    If Len(Result) > 0 Then
        Result = Left(Result, Len(Result) - Len(Delimiter))
    End If
    
    CustomJoin = Result
End Function
  1. Close the VBA Editor and return to your Excel sheet.

You can now use this newly created custom function in your spreadsheet just like any native formula:

=CustomJoin(A2:A10, ", ")

Summary of Best Practices

Your Excel Version Recommended Method Key Benefit
Excel 365 / 2019 / Web =TEXTJOIN(", ", TRUE, Range) Fastest, cleanest, and automatically handles blank cells.
Excel 365 / 2019 / Web (Filtered) =TEXTJOIN(", ", TRUE, FILTER(...)) Allows you to conditionally combine cells based on criteria.
Excel 2016 / 2013 Helper Column / Ampersand (&) Does not require modern Excel or macros.
Any Version (Macro-enabled) VBA User Defined Function (UDF) Customized automation and backwards compatibility.

By selecting the method that matches your Excel version and operational needs, you can rapidly manipulate, format, and present your raw cell ranges in a professional, comma-delimited layout.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.