Combining Left and Right Characters in Excel Using Formulas

📅 Feb 09, 2026 📝 Sarah Miller

Manually reconciling disjointed data fields in Excel often leads to costly formatting errors and lost productivity. This challenge frequently arises when tracking complex project portfolios, where standard funding sources-such as federal grants and private equity-require highly specific, consolidated identification codes. Mastering a formula that combines left and right characters grants analysts the power to automate this data harmonization instantly.

As a key stipulation, users must ensure consistent string lengths in source cells to prevent unexpected truncation. For example, extracting prefix and suffix elements to create the unified code "US-99" is easily achieved using the formula =LEFT(A2,3)&RIGHT(B2,2).

The following guide details the precise syntax, nested variations, and troubleshooting steps to implement this solution seamlessly.

Combining Left and Right Characters in Excel Using Formulas

Excel Formula to Combine Left Characters with Right Characters

Data manipulation is one of the most common tasks performed in Microsoft Excel. Whether you are clean-up raw data exported from an enterprise database, formatting system-generated serial numbers, or preparing an email list, you often need to extract and merge specific parts of text strings. One highly frequent scenario is extracting characters from both the beginning (left) and the end (right) of a text string and combining them into a single, cohesive cell.

In this comprehensive guide, we will explore how to combine left and right characters in Excel using various formulas. We will cover basic concatenation, adding delimiters, masking sensitive data, and handling tricky situations like dates, numbers, and extra spaces.

Understanding the Core Functions: LEFT, RIGHT, and Concatenation

To successfully combine characters from the left and right of a cell, you must understand three core components of Excel formulas: the LEFT function, the RIGHT function, and a method of concatenation (merging).

1. The LEFT Function

The LEFT function extracts a specified number of characters starting from the very beginning of a text string.

Syntax: =LEFT(text, [num_chars])

  • text: The cell or text string containing the characters you want to extract.
  • num_chars (Optional): The number of characters you want to extract. If omitted, it defaults to 1.

2. The RIGHT Function

The RIGHT function works identically to the LEFT function, but it extracts characters starting from the very end of a text string.

Syntax: =RIGHT(text, [num_chars])

  • text: The cell or text string.
  • num_chars (Optional): The number of characters to extract from the end. Defaults to 1 if omitted.

3. The Concatenation Operator (& )

To join the results of the LEFT and RIGHT formulas together, Excel uses the ampersand (& ) symbol. This operator acts as a "glue" between different text strings or formula outputs.


Method 1: Direct Combination (No Delimiter)

The simplest way to merge left and right characters is to combine them directly. This is useful when you want to strip out middle characters to create a shortened code or ID.

Imagine you have a product code in cell A2: "TX987654321CLASSIC". You want to extract the first 2 characters (the state abbreviation) and the last 7 characters (the product tier) to create a streamlined ID.

The Formula:

=LEFT(A2, 2) &
RIGHT(A2, 7)

How it works:

  • LEFT(A2, 2) extracts "TX".
  • RIGHT(A2, 7) extracts "CLASSIC".
  • The & operator merges them into "TXCLASSIC".

Method 2: Combining Left and Right Characters with a Delimiter

Often, merging raw text together makes it hard to read. You can inject a delimiter-such as a hyphen (-), space ( ), slash (/), or underscore (_)-between your extracted characters by placing the; quotation marks with; your formula.

Let's use the same cell A2 ("TX987654321CLASSIC") and combine the first 2 characters and last 7 characters, separated by a hyphen.

The Formula:

=LEFT(A2, 2) & "-" & RIGHT(A2, 7)

The Result: "TX-CLASSIC"

You can change the character inside the quotation marks to anything you require. For example, using " / " will result in "TX / CLASSIC".


Method 3: Creating Masked or Anonymized Data

A highly practical application of combining left and right characters is masking sensitive data for security and compliance purposes (such as GDPR or PCI standards). You might want to display only the first few and last few characters of a credit card number, Social Security number, or account ID, replacing the middle characters with asterisks (*).

Suppose cell A2 contains a bank account number: "987654321098". You want to display only the first two digits and the last four digits, with six asterisks in between.

The Formula:

=LEFT(A2, 2) & "" & RIGHT(A2, 4)

How it works:

  • LEFT(A2, 2) grabs "98".
  • The formula appends the literal string "".
  • RIGHT(A2, 4) grabs the last four digits, "2109".
  • Result: "982109"

Method 4: Using CONCAT and TEXTJOIN Functions

If you prefer using formal Excel functions instead of the ampersand operator, you can use the CONCAT or TEXTJOIN functions (available in modern Excel versions like Office 2019, 2021, and Microsoft 365).

Using CONCAT

The CONCAT function simply joins a list of strings together.

=CONCAT(LEFT(A2, 3), "-", RIGHT(A2, 3))

Using TEXTJOIN

The TEXTJOIN function is highly efficient because it allows you to specify a delimiter as its first argument and automatically applies it between all subsequent text extractions.

Syntax: =TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)

The Formula:

=TEXTJOIN("-", TRUE, LEFT(A2, 3), RIGHT(A2, 3))

This is extremely useful when combining three or more segments of a string, keeping your formula clean and readable.


Handling Common Pitfalls and Special Cases

While combining left and right characters is straightforward, real-world data can introduce bugs into your formulas. Here is how to fix the most common issues.

1. Eliminating Unwanted Spaces with TRIM

If your raw data has accidental leading or trailing spaces (e.g., " TX987654321CLASSIC "), your LEFT or RIGHT functions will extract those blank spaces instead of the characters you want.

To prevent this, wrap your cell reference inside the TRIM function, which automatically strips out all extra spaces.

The Formula:

=LEFT(TRIM(A2), 2) & "-" & RIGHT(TRIM(A2), 7)

2. Working with Formatted Numbers and Dates

Excel stores dates as serial numbers (e.g., January 1, 2023, is stored as the number 44927). If you attempt to run a LEFT or RIGHT formula on a date cell, Excel will extract characters from that underlying serial number, not the date format you see on screen.

To bypass this, you must convert the date or formatted number into a text string first using the TEXT function.

Imagine cell A2 contains the date 12/25/2023. You want to extract the first two characters of the month and the last two characters of the year.

The Incorrect Way: =LEFT(A2, 2) & RIGHT(A2, 2) (This will output characters from the number 45285, resulting in "4585").

The Correct Way:

=LEFT(TEXT(A2, "mm/dd/yyyy"), 2) & "-" & RIGHT(TEXT(A2, "mm/dd/yyyy"), 2)

Result: "12-23"


Practical Summary Reference Table

Here is a quick-reference table summarizing how different formulas behave with a sample input cell containing the text: "ABC-12345-XYZ".

Objective Formula Result
Combine first 3 and last 3 characters directly =LEFT(A2, 3) & RIGHT(A2, 3) "ABCXYZ"
Combine with a hyphen delimiter =LEFT(A2, 3) & "-" & RIGHT(A2, 3) "ABC-XYZ"
Mask the middle with "XXXX" =LEFT(A2, 3) & "XXXX" & RIGHT(A2, 3) "ABCXXXXXYZ"
Combine using the TEXTJOIN function =TEXTJOIN("/", TRUE, LEFT(A2, 3), RIGHT(A2, 3)) "ABC/XYZ"

Conclusion

Combining left and right characters in Excel is an essential skill that saves hours of manual data entry. By mastering the LEFT and RIGHT functions and joining them with the ampersand (&) operator, CONCAT, or TEXTJOIN, you can tackle almost any text-manipulation scenario. Remember to utilize the TRIM function to keep your data clean and the TEXT function to handle date and number formats properly.

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.