To combine names in two Excel columns, enter =A2&" "&B2 in a blank cell on row 2, replacing A2 and B2 with the cells containing the two name parts. The formula joins them with a space; fill it down the column to combine the remaining rows.
The basic formula for combining names
Suppose column A contains first names and column B contains last names, with the first person on row 2. Click an empty cell in C2 and enter the formula above. If A2 contains “Maya” and B2 contains “Chen,” C2 displays “Maya Chen.” The ampersand (&) joins text, and the quoted space puts a separator between the two cell values. Without that space, the result would be “MayaChen.”
After entering the formula, press Enter. The result is a formula, not a one-time text entry: if either source name changes, the combined name updates automatically. The source cells remain unchanged, so you can keep using them separately for sorting, filtering, or other calculations.
The same approach works for other name layouts. If the first and last names are in D5 and E5, for example, put the formula in another cell on row 5 and refer to D5 and E5. The important details are to use the right source cells and include the separator you want between them.
Fill the formula down for every row
Once the first result looks right, copy the formula to the other rows. Excel adjusts the row references as it fills: the formula in C2 refers to A2 and B2, while the copied formula in C3 refers to A3 and B3. These are relative references, which makes one formula practical for a whole list.
- Select the cell containing the formula, such as C2.
- Point to the small square at the bottom-right corner of the selected cell, called the fill handle.
- Drag the fill handle down through the rows that contain names. If the neighboring column has continuous data, you can often double-click the fill handle to fill down alongside it.
You can also select the formula cell and the blank cells below it, then use Home > Fill > Down. On Windows, Ctrl+D fills selected cells down; on Mac, use Command+D. Check the last few rows after filling, especially if the source list has gaps, because a double-click may stop at a blank in an adjacent column.
Choose the right separator and joining method
A space is the usual separator for first name plus last name, but the separator should match how you want the name displayed. For an initial and surname, a space may be appropriate; for a surname-first list, use a comma and a space. You can also join a title or middle name by including another cell reference in the desired position.
For a two-part name, the ampersand formula is compact and works in long-standing Excel versions. Another choice is TEXTJOIN, available in Excel for Microsoft 365 and Excel 2019 or later. With first names in A2 and last names in B2, enter =TEXTJOIN(" ",TRUE,A2,B2) in C2. It joins the values using a space and ignores empty cells, which can prevent an extra separator when one part is blank.
For names in A2, B2, and C2, where each cell contains one part such as first name, middle name, and last name, use =TEXTJOIN(" ",TRUE,A2,B2,C2) in D2. If B2 is empty, the result joins the first and last names with one space rather than leaving a doubled space. TEXTJOIN is useful when the number of parts varies, while ampersands are easy to understand for a simple two-column list.
Handle blank cells and extra spaces
The basic ampersand formula always inserts its separator. If B2 is empty, the result from the basic formula may end with a space; if A2 is empty, it may begin with one. These spaces are not always obvious on screen, but they can matter when you compare values or export the list to another system.
With first names in A2 and last names in B2, use =TEXTJOIN(" ",TRUE,A2,B2) in C2 if you want Excel to omit a separator for an empty cell. This does not remove spaces that are already inside either source cell. For example, a first name entered with a trailing space can still produce an uneven result.
To trim ordinary leading, trailing, and repeated spaces from both entries as they are joined, use =TEXTJOIN(" ",TRUE,TRIM(A2),TRIM(B2)) in C2, assuming the name parts are in A2 and B2. TRIM removes extra regular spaces within the text as well as at its edges. It does not remove every kind of invisible character; text copied from websites can contain nonbreaking spaces that may need separate cleanup. Review results before replacing the original data.
Put the surname first or include middle names
If the source columns contain first name in A2 and last name in B2, a direct surname-first formula can add a comma. For a complete record, use =B2&", "&A2 in C2; it returns “Chen, Maya.” This is straightforward when both fields are always filled.
If either name part may be empty and you want to avoid a dangling comma, use =IF(OR(A2="",B2=""),TEXTJOIN(", ",TRUE,B2,A2),B2&", "&A2) in C2, with first names in A2 and last names in B2. When both cells contain names, it returns “Chen, Maya.” When one is blank, it returns the nonblank part without a comma. If your desired output uses a different order or punctuation, adjust the order of the references and the text between them.
For a middle name or initial stored in a third column, TEXTJOIN can combine all three parts while skipping empty cells. Confirm the actual column order first: if a file stores middle name before first name, rearrange the references in the formula so the output reads naturally. Combining cells does not identify which part is a surname; it simply joins the values in the order you specify.
Keep the result as a formula or save fixed text
Formula results recalculate when the source cells change. This is useful when the original names may be corrected later, but it also means the combined column is dependent on the original columns. If you need a standalone list for an upload or handoff, copy the completed results and paste them as values in a destination range.
In Microsoft 365 for Windows, select and copy the combined cells, then use Home > Paste > Paste Values. The Paste Values option is also available from the right-click paste menu. On Mac, use Home > Paste > Paste Values or the corresponding Paste Values choice in the context menu. Check that the values appear correctly before deleting or overwriting the source columns; a normal paste would copy formulas rather than freeze their displayed text.
Before converting results to values, consider keeping a copy of the original workbook or retaining the separate name columns. Once formulas are replaced with fixed text, later changes to the source names will not flow into the combined list.
Use Flash Fill or a formula?
Flash Fill can recognize a pattern from an example and fill the rest of a column without leaving formulas. For example, type “Maya Chen” beside the first row of separate names, then use Data > Flash Fill. In Excel for Windows, Ctrl+E is the keyboard shortcut. If Excel does not infer the pattern correctly, enter another example or use a formula instead.
Flash Fill is convenient for a quick, one-time transformation, but its results are static: changing the source cells later does not update the filled names. A formula is usually better for a list that will be maintained, because it can be filled down and recalculates when its source values change. Flash Fill is also pattern-based, so inspect its output when names have inconsistent formats or missing parts.
For a two-column task, a formula is typically the clearest option. Flash Fill can be handy when you need a custom pattern that would take more effort to express, such as rearranging pieces or adding a consistent display format. Neither method verifies that the source names are spelled correctly.
Common problems and how to fix them
- The formula appears as text. Check that the destination cell is not formatted as Text. Change its number format to General, edit the cell, and press Enter again. Also make sure the formula begins with an equals sign and that Show Formulas is not turned on.
- The result has no space. Include a quoted space between the references, as in the basic formula. A separator must be included explicitly; Excel does not automatically know where one name part ends.
- Every row shows the same names. Check whether the formula references the correct row and whether dollar signs have locked the references. For ordinary filling down, references such as A2 and B2 should change to A3 and B3 on the next row.
- There are unwanted gaps or doubled spaces. Check for spaces already present in the source cells. TEXTJOIN with TRIM can clean ordinary spaces, but unusual invisible characters may require additional cleanup.
- The order looks wrong. A formula joins cells in the order written. Swap the references if the source columns are not arranged in the order you want to display.
Excel does not know that a particular cell is a first name or a surname; it treats the entries as text. The combined result can therefore be syntactically neat but still incorrect if the original columns are mislabeled, if a full name has been split inconsistently, or if the list includes suffixes that belong at the end.
Frequently Asked Questions
How do I combine first and last names in Excel with a space?
With first names in A2 and last names in B2, enter =A2&" "&B2 in C2, then fill the formula down. Change the cell references if your names are in different columns.
Can I combine two columns without leaving a space when one cell is blank?
Yes. With name parts in A2 and B2, enter =TEXTJOIN(" ",TRUE,A2,B2) in C2. TEXTJOIN ignores empty cells when its second argument is TRUE, so it does not add a separator for a missing part.
How do I make the combined names permanent?
Copy the formula results, then use Paste Values in the destination range. The output becomes fixed text and will no longer change if the source cells are edited.
Can I combine names in a different order?
Yes. Put the cell references in the order you want in the formula. To display surname, comma, then first name, with first names in A2 and surnames in B2, use =B2&", "&A2 in C2 when both parts are present.
Will the formula work if I add more rows later?
It will work for any row where the formula is filled. If you format the source range as an Excel table, a formula entered in a table column generally fills through that calculated column and is carried into new table rows. Check the new rows to confirm the formula was extended as expected.
Related
- Excel Dependent Drop-Down Lists in Microsoft 365
- Excel Dependent Drop-Down Lists With Spaces: Setup Guide
- Excel Dependent Drop-Down List: 3 Levels
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Count Unique Values in Excel: Formulas and MethodsTo count distinct, nonblank values in Excel for Microsoft 365, use =ROWS(UNIQUE(FILTER(A2:A20,A2:A20<>""))). This assumes the values are in…
- Excel Exponential Power Formula: Use the ^ OperatorTo raise a number to a power in Excel, use the caret operator: with the base in A2…
- Interpolate Between Two Points in Excel With a FormulaTo interpolate between two points in Excel, use a straight-line formula: estimated y = y1 + (target x…
- Excel Custom Text Filter: Find Matching Text in a ListTo use a custom text filter in Excel, open the filter arrow in a text column, choose Text…
- HLOOKUP Examples in Excel: Formulas and Common FixesIn Excel, HLOOKUP searches across the first row of a range and returns a value from a specified…
- How to Filter in Excel With Multiple CriteriaTo filter data by more than one condition in Excel, turn on filters for the full data range,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.