To concatenate names in Excel with a comma and a space, use =TEXTJOIN(", ",TRUE,A2:A4) when the names are in A2:A4; for two separate name cells, use =A2&", "&B2. The first formula joins a list of names, while the second combines two cell values, so choose the pattern that matches the result you want.
Decide what the comma should separate
“Concatenate names with a comma” can mean joining several names into one comma-separated list, or combining parts of one person’s name with a comma between them. These are different layouts, and choosing the right one avoids a result that looks technically correct but puts the name parts in the wrong order.
- A list of names: Turn names in separate rows, such as Ada, Grace, and Katherine, into Ada, Grace, Katherine.
- Two name parts: Combine a first-name cell and a last-name cell with a comma, such as Ada, Lovelace.
- Last name first: Reverse the cell order to produce Lovelace, Ada, a format often used in directories or reference lists.
In each case, the comma is ordinary text inside the formula. Add a space after it if you want the output to be easier to read. A comma without a following space produces results such as Ada,Grace.
Join a list with TEXTJOIN
For a range of names, TEXTJOIN is usually the simplest choice in Microsoft Excel for Microsoft 365 on Windows. It accepts a delimiter, a setting for whether to ignore empty cells, and the text or range to join. With names in A2:A4, enter this formula in another cell:
With names in A2:A4, the formula returns Ada, Grace, Katherine when those are the three cell values: =TEXTJOIN(", ",TRUE,A2:A4)
The first argument, ", ", is the delimiter: a comma followed by a space. The second argument, TRUE, tells Excel to ignore empty cells. The final argument is the range to combine. If A3 is blank, for example, Excel returns Ada, Katherine, rather than inserting an extra empty position and producing two adjacent separators.
TEXTJOIN is particularly convenient when the list changes. If you add another name inside the referenced range, the result updates automatically. Make sure the range includes the cells where future names will be entered; a formula referencing A2:A4 will not include a new value typed in A5. You can expand the range in the formula or use an Excel table if the list will grow regularly.
Combine first and last name cells
If each row contains one person, with a first name in column A and a last name in column B, join those two cells using the ampersand operator. This creates one result for that row. For the layout described, enter the formula in C2:
With the first name in A2 and the last name in B2, this formula returns Ada, Lovelace: =A2&", "&B2
To make the surname come first, switch the cell references. With the first name still in A2 and the last name in B2, this formula returns Lovelace, Ada: =B2&", "&A2
After entering a row formula, copy it down to apply the same pattern to other people. In Excel for Windows, select the formula cell and drag its fill handle (the small square at the lower-right corner) down the column. On Mac, the fill handle works in the same way. Excel adjusts relative references, changing A2 and B2 to A3 and B3 on the next row. The formula combines cell contents; it does not change the original cells.
Handle blanks and extra spaces
Blank cells are a frequent reason a joined name looks untidy. TEXTJOIN with its ignore-empty setting set to TRUE skips empty cells in a range. That behavior is useful for a list, but when combining first and last names from separate columns, a direct ampersand formula can leave a comma or space even when one cell is empty. For example, if B2 has no last name, the first-and-last formula still adds the comma and space after the value in A2.
For separate name fields, TEXTJOIN can also join the two cells while skipping blanks. With the first name in A2 and last name in B2, this returns Ada, Lovelace when both cells are filled, and just Ada if B2 is empty:
With the first name in A2 and the last name in B2, use: =TEXTJOIN(", ",TRUE,A2,B2)
Be aware that a cell containing spaces is not necessarily empty. If imported data has leading or trailing spaces, the result may have odd spacing even though the delimiter is correct. You can clean source data with Excel’s Trim command, or use a formula that applies TRIM to each cell. For example, with names in A2:A4, this formula joins trimmed cell contents and ignores cells that are genuinely blank after trimming:
With the list in A2:A4, this returns Ada, Grace, Katherine if the cells contain those names with accidental outer spaces: =TEXTJOIN(", ",TRUE,TRIM(A2:A4))
In Microsoft 365, array-aware behavior allows TRIM to process the range in this context. If your workbook must also work in older Excel releases, check compatibility before sharing a formula that relies on newer behavior.
Choose between TEXTJOIN, ampersand, and CONCAT
There is more than one way to join text in Excel, but the methods suit different jobs. TEXTJOIN is designed for joining multiple items with a repeated delimiter. The ampersand operator is direct and easy to read when combining a small, fixed number of cells. CONCAT can combine text or ranges but does not insert a delimiter automatically, so commas and spaces must be supplied separately.
- Use TEXTJOIN for a list or a variable number of cells when the same separator belongs between each item. Its ignore-empty option can prevent unwanted gaps.
- Use ampersands for a simple two-cell combination or when you need precise control over where punctuation appears.
- Use CONCAT when you want to join values without a repeated delimiter, or when you are working with an existing formula built around it.
For instance, with names in A2:A4, CONCAT requires the comma separators to be included explicitly. This returns Ada, Grace, Katherine when all three cells contain names:
With the names in A2, A3, and A4, use: =CONCAT(A2&", ",A3&", ",A4)
That approach is less convenient if the number of names changes, and it can leave extra punctuation if a middle cell is blank. CONCAT is available in modern Excel, including Microsoft 365, but TEXTJOIN is generally clearer for a delimited list. The older CONCATENATE function may appear in inherited workbooks; for new formulas, the ampersand or TEXTJOIN is usually easier to maintain.
Check punctuation and name formatting
A comma is not always the right separator for every name task. A comma between first and last name makes a format such as Doe, Jane, but standard display names more often use a space: Jane Doe. If that is what you want, replace the comma delimiter with a single space. With the first name in A2 and the last name in B2, enter:
With first name in A2 and last name in B2, this returns Jane Doe: =A2&" "&B2
For a comma-separated list, the comma belongs between people, not necessarily within each person’s name. Joining cells that already contain full names can produce Jane Doe, John Smith. By contrast, combining first and last names with a comma for every row produces Doe, Jane. Think about the final output’s use—such as a mailing list, directory, or text export—before deciding where punctuation should go.
Also consider whether the source cells contain middle names, suffixes, or preferred names. A formula that joins only columns A and B will not include a middle initial in column C unless you add that cell to the formula or use a range-based approach. Check a few representative rows before filling a formula down thousands of records.
Common problems and fixes
If the formula appears as text in the cell instead of calculating, the cell may be formatted as Text, or the formula may have been entered with an apostrophe before the equals sign. Change the cell format to General, then re-enter the formula. In Windows, pressing F2 and then Enter can make Excel re-evaluate a formula in the selected cell; on many Mac keyboards, use Control+U or edit the cell and press Return, depending on keyboard settings.
If Excel reports that there is a problem with the formula, confirm that the quotation marks are straight double quotes and that parentheses are balanced. The formulas here use commas between function arguments, as in standard English-language Excel settings. Some regional settings use semicolons as argument separators, so Excel may require the equivalent semicolon-separated version in those environments. The comma inside the quoted delimiter remains part of the desired output.
- Unexpected double commas: Check for blank cells when using ampersands or a manually assembled CONCAT formula. TEXTJOIN with TRUE can skip empty cells.
- No space after the comma: Use a delimiter containing both comma and space, written as
", ". - Names in the wrong order: Swap the cell references, for example, use the last-name cell before the first-name cell.
- Some names missing: Expand the referenced range and verify that the source cells contain values rather than formulas returning an empty string.
Frequently Asked Questions
How do I concatenate a column of names with commas?
With names in A2:A20, use =TEXTJOIN(", ",TRUE,A2:A20). It joins the non-empty cells with comma-space separators. Adjust the range to match your data.
How do I put the last name before the first name?
With the first name in A2 and the last name in B2, use =B2&", "&A2. The result is Last, First, such as Lovelace, Ada.
Can I join names without a comma?
Yes. With first and last names in A2 and B2, use =A2&" "&B2 for a space between them. For a list in a range, change TEXTJOIN’s delimiter to a space or another separator you need.
Does TEXTJOIN skip blank cells?
It does when the second argument is TRUE. For example, =TEXTJOIN(", ",TRUE,A2:A10) ignores empty cells in that range. A cell containing spaces may not count as empty, so clean the data if necessary.
Why is TEXTJOIN not recognized?
The function is available in Microsoft 365 and newer Excel versions, but it may be unavailable in an older release. If the workbook must run on older software, use ampersands for a fixed number of cells or check which Excel version will open the file.
These formulas work in Excel for Microsoft 365 on Windows and are also supported in current Excel for Mac and Excel for the web. The function’s availability depends on the Excel version, not on whether the workbook is opened on Windows or Mac.
Related
- Average Shortcut in Excel: Fast Ways to Calculate Mean
- Autofit Pictures in Excel: Fit Images to Cells
- Autofit Page in Excel: Fit a Worksheet to One Page
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Data Sorting: Sort Rows, Columns, and Lists CorrectlyTo sort data in Excel for Microsoft 365 on Windows, click a cell in the column you want…
- Excel Data Validation Custom Formula Examples That WorkExcel custom data validation lets you accept an entry only when a formula returns TRUE. In Microsoft 365…
- How to Find Variance in Excel: Formulas and ExamplesTo find variance in Excel, enter =VAR.S(B2:B6) for a sample or =VAR.P(B2:B6) for an entire population, replacing the…
- Excel Compare Two Sheets for Matching Names: FormulasTo compare names in two worksheets, enter a formula beside the names on the first sheet and check…
- Excel Null Values: Blanks, Formulas, and Power QueryMicrosoft Excel does not have a special worksheet value called NULL in the way a database does. What…
- COUNTIF Excel Formula Examples and How to Use ThemIn Excel, COUNTIF counts cells in a range that meet one condition. Its basic pattern is =COUNTIF(range,criteria); for…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.