How to Concatenate Function in Excel
Learn multiple Excel methods to concatenate function with step-by-step examples and practical applications.
How to Concatenate Function in Excel
Why This Task Matters in Excel
Combining or “concatenating” text is a deceptively simple skill that underpins countless day-to-day operations in Excel–from building dynamic report headers to crafting customer-facing part numbers. Imagine a sales analyst who receives weekly extracts in which first and last names live in separate columns. If those two columns remain isolated, mailing lists can’t be generated, CRM imports will fail, and dashboards look unprofessional. Concatenation solves that bottleneck instantly.
In finance, analysts routinely join fiscal period codes with cost-center IDs to form unique keys. Without a robust concatenation workflow, every subsequent lookup or PivotTable collapses because unique identifiers don’t exist. Marketing teams append tracking codes to campaign URLs; operations managers stitch warehouse codes to SKU numbers; HR professionals merge employee ID prefixes with hire years. Despite the wide variety of industries, the underlying need is the same: turn scattered pieces of information into a single, meaningful string.
Excel shines here because it offers several dedicated functions and operators that handle concatenation at scale. The flexibility to concatenate tens of thousands of rows, apply number formatting on the fly, ignore blank cells, and even add delimiters automatically makes Excel an ideal environment. Neglecting these skills leads to manual copy-pasting, accidental data corruption, and an overall slowdown of reporting cycles. Mastering concatenation is therefore more than a quality-of-life upgrade; it is a foundation for VLOOKUP/XLOOKUP reliability, advanced Power Query merges, and cleaner exports to BI tools.
Best Excel Approach
Excel offers three primary ways to concatenate: the ampersand (&) operator, the legacy CONCATENATE function, and the modern CONCAT and TEXTJOIN functions. For new workbooks, TEXTJOIN is usually the best approach because it accepts an entire range, lets you specify a delimiter once, and can optionally ignore blank cells—cutting formula maintenance in half.
Use TEXTJOIN when you need flexibility, automatic delimiters, or when you anticipate adding more columns later. Reserve CONCAT or the ampersand for ultra-simple expressions with only a handful of cells, or when compatibility with Excel 2013 and earlier is mandatory (ampersand works everywhere).
Prerequisites are minimal: verify that the target text cells contain values you want—dates should already be formatted as text, or wrapped in TEXT to preserve readability. When numbers need zero-padding (e.g., \"007\"), apply TEXT with custom formats inside your concatenation.
Recommended syntax:
=TEXTJOIN(" ",TRUE,A2:C2)
- \" \" – space delimiter
- TRUE – ignore blank cells
- A2:C2 – range to join in row 2
Alternative approach (legacy compatibility):
=A2 & " " & B2 & " " & C2
Parameters and Inputs
TEXTJOIN requires three inputs.
- Delimiter (text) – any character(s) you want inserted between joined items: a space \" \", comma and space \", \", line break CHAR(10), etc.
- Ignore_empty (logical) – TRUE to skip blank cells, FALSE to treat blanks as empty strings so consecutive delimiters appear.
- Text1, Text2, … (arguments or ranges) – the cells, constants, or arrays you want to combine. You can pass a single range like [A2:C2] or mix ranges and individual cells. TEXTJOIN supports up to 252 text arguments, and each argument can be an array.
For CONCAT the parameter list is simpler: just Text1, Text2… with no delimiter management. Ampersand simply joins two operands at a time.
Prepare your data by trimming excess spaces with TRIM, confirming data types, and applying TEXT(number,\"00\") when you need fixed-width numeric codes. Validate that delimiter characters do not also appear within the data unless that is intentional. For line-break delimiters, enable Wrap Text on the target cell so results display correctly. Edge cases include double-byte characters in non-English data and cells exceeding Excel’s 32,767-character limit; if results might hit that limit, add LEN checks and error messaging to warn users.
Step-by-Step Examples
Example 1: Basic Scenario
Suppose you manage a simple contact list with First Name in [A2:A10] and Last Name in [B2:B10]. The goal is to create full names in [C2:C10] with a space in between.
- Click cell C2.
- Enter the formula:
=CONCAT(A2," ",B2)
- Press Enter, then double-click the fill handle to copy the formula through C10.
Expected result in C2: \"Olivia Martin\". The CONCAT function processes each argument in the order supplied, inserting the space constant \" \" between the first and last names.
Why it works: Each cell reference (A2, B2) feeds its text content into CONCAT. The space in quotes counts as a third argument. CONCAT simply strings them together in sequence.
Common variations
- Replace CONCAT with the & operator:
=A2 & " " & B2 - If some rows have missing last names, switch to TEXTJOIN to skip the extra space:
=TEXTJOIN(" ",TRUE,A2,B2)
Troubleshooting
- Extra spaces? Use TRIM(A2) inside the formula.
- Names displaying as 0? Verify cells contain text, not zero-formatted numbers.
Example 2: Real-World Application
A logistics manager needs to generate shipment IDs in column F by combining Warehouse Code [B2:B5000], Item SKU [C2:C5000], and Shipment Date [D2:D5000] formatted as yyyymmdd. The components must be separated by a hyphen.
- Confirm column D contains valid Excel dates.
- In F2 type:
=TEXTJOIN("-",FALSE,B2,C2,TEXT(D2,"yyyymmdd"))
- Copy the formula down to row 5000.
Business logic:
- TEXTJOIN uses \"-\" to delimit parts.
- FALSE means do not ignore blanks (a missing component should raise quality questions in downstream QA).
- TEXT converts the date from a serial number to an eight-digit string to maintain lexicographic sorting.
Results: \"DAL-AX512-20231204\"
Integration: Because the ID is deterministic, you can now rely on it as a key in a Power Query merge or as a slicer in a PivotTable. When new columns get added—for instance, Package Type—you only adjust the formula by inserting an argument; you never rewrite dozens of \"&\" connectors.
Performance on 5,000 rows with TEXTJOIN is trivial, but if you scale to 300,000 records, calculate results in a helper column once, then copy-paste values to avoid recalculation on every worksheet change.
Example 3: Advanced Technique
Your data warehouse export places address blocks across six columns: Street, City, State, Postal Code, Country, and an optional Suite field. You must export a CSV where each row’s Address cell contains multi-line output with blank elements skipped and Windows line breaks (CRLF).
- Ensure Wrap Text is on for visibility.
- Define a named range AddressParts = [B2:G2].
- In H2 enter:
=TEXTJOIN(CHAR(13)&CHAR(10),TRUE,AddressParts)
- Fill down.
Explanation:
- CHAR(13)&CHAR(10) creates a carriage return + line feed, which most Windows systems interpret as a new line.
- TRUE skips blank cells so suites that don’t exist don’t leave empty lines.
- Because AddressParts references an entire contiguous range, the formula automatically adapts when you insert “Province” between City and State.
Error handling: Add an IF test around the join to flag rows missing mandatory fields.
=IF(COUNTBLANK(AddressParts)>1,"Address Incomplete",
TEXTJOIN(CHAR(10),TRUE,AddressParts))
Professional Tips
- For downstream systems that cannot accept line breaks, replace CHAR(13)&CHAR(10) with \", \".
- Large concatenations may exceed Excel’s character limit; wrap the result in IFERROR to show “Too long” when LEN exceeds 32,767.
Tips and Best Practices
- Centralize Delimiters: Store frequently used delimiters in a named cell like Settings!B\2 = \", \" and reference it:
=TEXTJOIN(Settings!B2,FALSE,A2:D2)to maintain consistency. - Use TEXT for Numbers: Pad invoice numbers or month codes with TEXT(value,\"0000\") before concatenating to prevent the dreaded loss of leading zeros.
- Leverage Named Ranges: Group related cells into self-documenting names (e.g., FullAddressRange) to shorten formulas and improve readability.
- Convert to Values for Performance: After generating static IDs, copy and “Paste Values” to cut recalculation time on massive spreadsheets.
- Wrap in IFERROR: Guard mission-critical concatenations with IFERROR to display clear messages rather than #VALUE! in production dashboards.
- Line-Break Awareness: Always enable Wrap Text and adjust row height when you use CHAR(10) to avoid apparent data loss.
Common Mistakes to Avoid
- Forgetting Delimiters: Users often write
=A2&B2and wonder why \"GeorgeSmith\" appears. Always include explicit delimiters unless you truly want none. - Mismatched Data Types: Concatenating a number with text may suddenly show as a date (e.g., \"1/1/1900-ABC\"). Apply TEXT to force clear formatting.
- Trailing Delimiters: In ampersand formulas, placing the delimiter at the end of each cell reference (
=A2&", "inside a spill range) creates ugly commas at the end. TEXTJOIN with ignore_empty = TRUE eliminates this. - Exceeding Character Limits: Long address or product specification merges can silently cut off at 32,767 characters. Always use LEN to audit critical exports.
- Blank Suppression Missteps: Setting ignore_empty to FALSE in TEXTJOIN when blanks exist produces back-to-back delimiters, confusing downstream parsers. Validate this switch carefully.
Alternative Methods
| Method | Excel Version | Pros | Cons | Ideal Use Case |
|---|---|---|---|---|
| Ampersand (&) | All | Fast, lightweight, universal | Difficult to maintain, no automatic delimiters | Small formulas, backward compatibility |
| CONCATENATE (legacy) | 2016- | Familiar to long-time users | Limited to 255 arguments, verbose | Documents with minimal updates |
| CONCAT | 2019/365 | Accepts ranges, shorter than ampersand | No delimiter argument | Medium-complex merges where you supply delimiters manually |
| TEXTJOIN | 2019/365 | Built-in delimiter, ignore blanks, range friendly | Not in Excel 2016 stand-alone | Large datasets, dynamic columns |
| Power Query Merge | 2010- (add-in) | No formulas, refreshable, handles millions of rows | Steeper learning curve, not cell-level | Reusable data cleansing pipelines |
| VBA Custom Function | Any | Full control, loops, exotic delimiters | Requires macros enabled, maintenance overhead | Automated reporting templates |
Use ampersand when supporting users stuck on ancient versions. Move to TEXTJOIN for any modern workflow requiring maintainability. If performance tops your priority list and you handle hundreds of thousands of rows, push the concatenation into Power Query or Power BI, then load the clean result back into Excel.
FAQ
When should I use this approach?
Apply TEXTJOIN or CONCAT when you need to build identifiers, addresses, or sentences from multiple columns and want to reduce manual typing. Choose TEXTJOIN specifically when you must insert the same delimiter and suppress blanks in one step.
Can this work across multiple sheets?
Yes. Reference cells by qualifying the sheet name, e.g., =Sheet1!A2 & " - " & Sheet2!B2. For an entire row in another sheet:
=TEXTJOIN(", ",TRUE,Sheet2!A2:F2)
Ensure both sheets remain in the same workbook or update formulas after moving sheets.
What are the limitations?
Concatenated results cannot exceed 32,767 characters. TEXTJOIN is unavailable in Excel 2013 and earlier. CONCATENATE accepts only 255 arguments. Ampersand formulas become unwieldy with many cells. Complex dynamic arrays may require spilling workarounds.
How do I handle errors?
Wrap your formula in IFERROR:
=IFERROR(TEXTJOIN(", ",TRUE,A2:D2),"Data error")
Check LEN for excessive length, and use COUNTBLANK to detect missing fields before concatenation.
Does this work in older Excel versions?
Ampersand and CONCATENATE work in all versions. TEXTJOIN and CONCAT require Excel 2019, Excel 2021, or Microsoft 365. For Excel 2016 users on Office 365 subscription, TEXTJOIN appears after the July 2016 updates. Power Query concatenation is available in Excel 2010 through the free add-in.
What about performance with large datasets?
In native worksheets, TEXTJOIN outperforms equivalent ampersand chains by minimizing function calls. On datasets over 200,000 rows, freeze recalculation (Formulas > Calculation Options > Manual) during entry, or push workloads to Power Query. Avoid volatile functions (e.g., INDIRECT) inside concatenation.
Conclusion
Concatenation turns fragmented data into actionable information and acts as a cornerstone for lookups, reporting, and integration with other systems. By mastering tools like TEXTJOIN, CONCAT, and the trusty ampersand operator, you streamline data cleaning, accelerate workflows, and lay the groundwork for advanced analytics. Continue refining your skills by experimenting with custom number formats inside TEXT, exploring dynamic arrays, and moving heavy transformations into Power Query when the workbook grows. Embrace these practices, and your Excel models will remain robust, scalable, and impressively professional.
Related Articles
How to Show the 10 Most Common Text Values in Excel
Learn multiple Excel methods to list the 10 most frequent text values—complete with step-by-step examples, business use cases, and expert tips.
How to Abbreviate Names Or Words in Excel
Learn multiple Excel methods to abbreviate names or words with step-by-step examples and practical applications.
How to Abbreviate State Names in Excel
Learn multiple Excel methods to abbreviate state names with step-by-step examples, professional tips, and real-world applications.