Merge first and last name Excel formula How to do it correctly

To merge first and last names correctly in Excel, preventing errors and ensuring consistent formatting, use the following formulas. Always account for the necessary space between the names.

Recommended Method: Using the Ampersand (&) Operator

This is the most straightforward and efficient approach:

Formula:

Merge first and last name Excel formula How to do it correctly

=A2 & " " & B2

Explanation:

  • A2: Cell containing the first name.
  • B2: Cell containing the last name.
  • " ": The space enclosed in quotes ensures a separator between names.

Example: If A2 holds "John" and B2 holds "Doe", the result is "John Doe".

Alternative Method: Using CONCAT or CONCATENATE

Formula (CONCAT - Recommended for Excel 2019, Microsoft 365):

=CONCAT(A2, " ", B2)

Merge first and last name Excel formula How to do it correctly

Formula (CONCATENATE - Older versions):

=CONCATENATE(A2, " ", B2)

Explanation:

  • Both functions combine text from multiple cells or strings.
  • Include " " as a separate argument to add the space between names.

Critical Best Practices

  • Always Include the Space: Omitting the space (" ") results in joined names (e.g., "JohnDoe"). This is the most common error.
  • Handle Empty Cells: If either cell might be empty, use nested IF or IFS functions to avoid extra spaces (e.g., =TRIM(CONCAT(A2, " ", B2)) works if only one cell has data).
  • Data Consistency: Ensure your name data doesn't contain leading/trailing spaces. Use TRIM function (e.g., =TRIM(A2) & " " & TRIM(B2)) for cleaning.
  • #NAME? Error: This usually indicates a misspelling of CONCAT or CONCATENATE. Double-check spelling.
  • Reference Correct Cells: Verify cell references (A2, B2) match your actual data location.

Using & " " & or CONCAT with an explicit space argument guarantees accurate merging of first and last names.

Related News