How to Combine Names in Excel With a Formula Easily

Formulas & functions · Updated November 20, 2026

To combine first, middle, and last names in Excel, put them in separate columns and enter =TRIM(A2&" "&B2&" "&C2) in the result column, assuming first names are in A, middle names in B, and last names in C. The formula joins the values with spaces, and TRIM removes extra spaces when a name part is blank. You can use a shorter formula for two columns or TEXTJOIN when you want more control over empty cells.

These methods work in Microsoft Excel for Microsoft 365 on Windows. The formulas also work in Excel for Mac and Excel for the web, though the location of ribbon commands and some keyboard shortcuts can differ. Keep the original name columns until you have checked the combined results; formulas can be copied or converted to fixed text later.

What You’ll Need

  • An Excel workbook with the names you want to combine, ideally arranged in separate columns with one person per row.
  • A blank column for the combined names. For example, use columns A, B, and C for first, middle, and last names, and column D for the result.
  • A header row is helpful but not required. If row 1 contains headers, enter the first formula in row 2.

Step-by-Step

  1. Check how the names are arranged. Each part of a person’s name should be in its own cell on the same row. For example, A2 might contain Maya, B2 might contain Lee, and C2 might contain Chen. If you have only first and last names, you only need two source columns. This approach combines existing parts; it does not reliably split a full name that is already stored in one cell.
  2. Choose the result column. Click the empty cell beside the first person’s details. With the example layout, click D2 and consider typing a heading such as Full Name in D1. Keeping the result in a separate column prevents the formula from overwriting the source names and makes it easier to compare the output against the original data.
  3. Join two name parts with the ampersand operator. With first names in A2 and last names in B2, enter =A2&" "&B2 in C2. The ampersand joins cell contents, while the quoted space adds a gap between them. If A2 contains Maya and B2 contains Chen, the result is Maya Chen. Without the quoted space, Excel would return MayaChen.
  4. Combine three name parts and handle blanks. With first, middle, and last names in A2, B2, and C2, enter =TRIM(A2&" "&B2&" "&C2) in D2. If the cells contain Maya, Lee, and Chen, the result is Maya Lee Chen. If B2 is empty, TRIM removes the extra spaces at the beginning or end, leaving Maya Chen. TRIM also reduces repeated spaces inside the result to a single ordinary space.
  5. Use TEXTJOIN if some name parts are often empty. With the parts in A2:C2, enter =TEXTJOIN(" ",TRUE,A2:C2) in D2. The first argument is the separator, a single space; TRUE tells Excel to ignore empty cells; and A2:C2 is the range to combine. For Maya in A2, a blank B2, and Chen in C2, the result is Maya Chen. TEXTJOIN is available in Microsoft 365 and Excel 2019 or later. If your Excel version does not recognize it, use the TRIM formula above.
  6. Confirm the first result before filling the column. Press Enter and check that the spacing and order look right. For example, verify that you see Maya Lee Chen rather than MayaLeeChen or Maya Lee Chen. Also check a row with a blank middle name if your list contains one. A correct result in the first row is a useful check, but names in later rows may still have missing or misplaced source data.
  7. Copy the formula down the list. Select the cell with the working formula. Point to the small square at its lower-right corner, called the fill handle, and drag it down to the last row. If the adjacent column has a continuous block of data, you can double-click the fill handle to fill down alongside it. Excel adjusts relative references automatically: a formula using A2, B2, and C2 becomes one using A3, B3, and C3 on the next row. Check the final few rows to make sure the formula reached the whole list.
  8. Review the combined names and decide whether to keep formulas. Look for missing parts, extra spaces, unexpected punctuation, or a row whose names appear in the wrong order. If the combined column must remain linked to the source columns, leave the formulas in place. If you need a fixed list that will not change when the source data changes, copy the results and use Home > Paste > Paste Values. In Excel for Mac, use the Paste Values option from the Home tab or the paste menu; in Excel for the web, use the Paste Values option available on the Home tab.

Common Mistakes

Leaving out the separator. Joining A2 and B2 directly produces a result with no gap. Include a quoted space between the references, as in the two-column example. For a comma, hyphen, or other separator, put that character inside the quotation marks instead. Choose punctuation that fits the data; a hyphen is not appropriate for every name.

Using a formula that leaves unwanted spaces. A simple join with spaces can leave two spaces where a middle name is blank, or a leading or trailing space when the first or last name is missing. Use TRIM around an ampersand formula, or TEXTJOIN with its ignore-empty setting set to TRUE. Neither method cleans every unusual character: imported data can contain nonbreaking spaces, which TRIM may not remove.

Putting the formula in a source cell. If you place the result formula in a cell it refers to, Excel may report a circular reference or overwrite data you need. Use a separate output column and check the cell references before pressing Enter.

Filling only part of the list. A formula can be correct at the top and absent from lower rows. After filling down, compare the output’s last row with the source data’s last row. Also watch for blank rows in the source, because double-clicking the fill handle may stop at a gap in an adjacent column.

Expecting the formula to change name order or formatting. The formula combines cells in the order you specify; it does not identify which part is a surname, add titles, or standardize capitalization. For example, if the source columns are last name then first name, reference them in the intended display order instead.

Tips

Use a clear header such as Full Name for the result column. That makes it easier for someone else to understand what the new values contain, especially if the workbook has several name fields. Keep the source columns too: they let you fix a typo or change the display format without retyping every combined name.

Choose the simplest formula that fits your layout. For exactly two consistently filled columns, the ampersand method is easy to read and works in old and new Excel versions. For three parts with an optional middle name, TRIM is a convenient option. For a range containing several optional parts, TEXTJOIN is often easier to maintain because it can skip blank cells. It only skips cells that are truly empty; a cell containing a formula that returns an empty string is also treated as empty, but a cell containing a space is not.

When the formula is correct, you can copy it down with the fill handle or copy and paste it into the remaining result cells. If the source names may be edited later, formulas keep the combined column up to date. If you send a static copy to another system or person, paste values so the recipient sees the names rather than needing the source columns and formulas. Keep a copy of the workbook before removing or replacing source data.

Excel normally recalculates formulas automatically when referenced cells change. If a combined name does not update, check Formulas > Calculation Options and make sure Automatic is selected. Avoid manually typing over just one result in the middle of a formula-filled column: that creates an exception, and later edits to its source row will not flow through.

Troubleshooting

The formula appears as text instead of returning a name. The cell may be formatted as Text, or there may be an apostrophe before the equals sign. Change the cell format to General from Home > Number Format, then edit the cell and press Enter to make Excel evaluate the formula. Changing the format alone may not convert a formula already entered as text; re-enter it after changing the format.

Excel displays an error after you enter the formula. Check that every opening parenthesis has a closing one and that quotation marks around the separator are straight double quotes. In some regional settings, Excel expects semicolons instead of commas between function arguments. For TEXTJOIN, use the separator your Excel installation expects. The ampersand examples do not use function-argument separators, so they can be a useful alternative if your version or regional settings make a function formula difficult to enter.

The output has odd spaces even with TRIM. Check whether the source cells contain a nonbreaking space or other imported character. A practical first step is to inspect and retype the affected source name, or use Find and Replace on the source data if you can identify the unwanted character. Do not replace ordinary spaces blindly if they are needed between parts of a name.

TEXTJOIN returns a name with a missing part or gives a function error. Confirm that the intended range is correct and that the middle or other optional cell is actually blank. If Excel shows #NAME?, your version may not support TEXTJOIN; use the TRIM and ampersand method instead. If the result omits a name you expected, inspect that source cell for an unexpected blank or formula result.

Some rows did not receive a formula. Select a completed result cell and fill it farther down, or copy it and paste into the remaining result cells. When using the double-click fill handle, Excel may stop at the end of a neighboring data block, so dragging to the known last row is more dependable when there are gaps.

Frequently Asked Questions

How do I combine only first and last names?
With first names in A2 and last names in B2, enter =A2&" "&B2 in the result cell. It joins the two values with one space. Use a TRIM-wrapped version if either cell can be blank.

How do I combine first, middle, and last names when the middle name is optional?
With the three parts in A2:C2, use =TEXTJOIN(" ",TRUE,A2:C2) to skip empty cells. Alternatively, use =TRIM(A2&" "&B2&" "&C2) when TEXTJOIN is unavailable.

Can I join names with a comma or hyphen instead of a space?
Yes. Put the separator you want between the quotation marks in the formula. For example, a comma followed by a space produces a format like Chen, Maya. Check that the chosen order and punctuation suit the way the names will be used.

Will the combined name update if I edit a source cell?
Yes, as long as the result is still a formula and Excel calculation is set to Automatic. If you paste the result as a value, it becomes fixed text and will not update when the source names change.

Can I combine names without a formula?
Yes. Copy the source data and use Excel’s Flash Fill from Data > Flash Fill, or press Ctrl+E on Windows after typing an example in the output column. Flash Fill infers a pattern rather than creating a live formula, so check its results carefully, especially with optional middle names or inconsistent formats. On Mac, use Data > Flash Fill where available; the Windows Ctrl+E shortcut does not apply.

Does this method work in Excel for Mac and Excel for the web?
Yes. The ampersand, TRIM, and TEXTJOIN formulas work in current Excel for Mac and Excel for the web. Ribbon locations and keyboard shortcuts can differ, but the cell references and formula logic are the same.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.