Convert Multiple Lines to Single Cell in Excel: A Step-by-Step Guide

Abstract: Merge multiple lines of text into a single cell in Excel using TEXTJOIN or manual concatenation while preserving line breaks.

Created: 2026-08-21 by
To combine multiple lines of text into a single cell in Excel, use the TEXTJOIN function with a line break character as the delimiter. This method efficiently merges vertical or horizontal ranges while preserving the original content structure. For older Excel versions without this function, you must rely on manual concatenation or VBA macros to achieve similar results without losing data integrity.

Using TEXTJOIN for Modern Excel Users

The most efficient way to merge cells containing line breaks is using the TEXTJOIN function, available in Excel 2019 and Office 365. This function allows you to specify a delimiter and ignore empty cells, making it ideal for cleaning up messy datasets where multiple entries exist across several rows within a single logical group. First, select the destination cell where you want the combined text to appear. Then, enter the following formula structure:
=TEXTJOIN(CHAR(10), TRUE, A1:A10)
In this example, CHAR(10) represents the line break character. The second argument, TRUE, instructs Excel to ignore any blank cells within the range A1:A10. If you prefer a comma and space between items instead of line breaks, replace CHAR(10) with ", ". After entering the formula, press Enter. You may need to enable "Wrap Text" in the Home tab formatting options to see all the merged content clearly within the cell. This approach is superior to older methods because it dynamically updates if the source data changes. It also handles large ranges without requiring complex array formulas that can slow down performance. For users dealing with extensive datasets, this single formula replaces hours of manual copying and pasting.

Handling Older Versions of Excel

If you are using Excel 2016 or earlier, TEXTJOIN is not available. In these cases, you must use alternative strategies depending on the size of your dataset. For small ranges, manual concatenation is feasible but tedious. You can link cells together using the ampersand (&) operator. For instance, to combine cells A1 through A5 with line breaks, you would write:
=A1 & CHAR(10) & A2 & CHAR(10) & A3 & CHAR(10) & A4 & CHAR(10) & A5
While functional, this method does not scale well. Adding more cells requires rewriting the entire formula. Additionally, manually typing each reference increases the risk of errors. If you frequently need to perform this task in older versions, consider creating a custom VBA macro. A simple User Defined Function (UDF) can mimic TEXTJOIN behavior by looping through the selected range and appending values with the desired delimiter. Another workaround involves using Power Query. Import your data into Power Query, group the relevant rows, and then concatenate the text column using the built-in aggregation features. This method is robust for recurring data cleaning tasks and does not require coding knowledge beyond basic navigation of the Power Query interface.

Common Issues and Troubleshooting

Users often encounter issues when the line breaks do not display correctly after merging. The primary cause is usually that "Wrap Text" is not enabled for the destination cell. Without this setting, Excel displays only the first line of the merged content, cutting off the rest visually even though the data is present. Ensure that the column width is sufficient to view the entire content. Sometimes, the text is there but compressed into a narrow width. Adjusting the row height manually can also help visualize the full output during testing. Another common error is the inclusion of unwanted spaces or delimiters at the beginning or end of the string. This typically happens if the source range includes empty cells and the ignore_empty argument is set to FALSE. Always verify your source data for blanks before applying the formula. If you suspect hidden characters are interfering, use the TRIM function to remove extra spaces before joining. For those interested in further text manipulation techniques, such as removing specific characters that might interfere with your joins, check out our guide on Removing Numbers from Text in Excel: A Step-by-Step Guide. Understanding how to clean individual cells ensures that your joined output remains consistent and professional.

Best Practices for Data Integrity

When combining text, always preserve the original data in a separate column until you verify the result. This safety net allows you to revert easily if the formula produces unexpected outcomes. Additionally, document the delimiter choice used in your spreadsheet. Future users of the file will appreciate knowing whether line breaks, commas, or pipes were used to separate the values. Consider using named ranges for the source data. This makes your formulas easier to read and maintain. Instead of referencing A1:A10, you can reference SourceData. This abstraction reduces clutter and minimizes errors when copying formulas to other parts of the workbook. Finally, be mindful of cell character limits. Excel cells have a maximum capacity of 32,767 characters. While rare, extremely long concatenations can hit this limit. If you anticipate very large outputs, test with a subset of your data first to estimate the final length.

Frequently Asked Questions

How do I keep line breaks visible after joining?

You must enable the "Wrap Text" option in the Home tab for the destination cell. Without this setting, Excel truncates the visual display to the first line, hiding the rest of the content even though it exists in the cell.

Can TEXTJOIN handle non-contiguous ranges?

No, TEXTJOIN requires a continuous rectangular range. To join non-adjacent cells, you must list them individually separated by commas within the arguments, such as =TEXTJOIN(",", TRUE, A1, C1, E1).

What is the difference between CHAR(10) and CHAR(13)?

CHAR(10) is the standard line feed used in Windows and modern Excel contexts. CHAR(13) is a carriage return, typically associated with older Mac systems or specific PDF exports. Using CHAR(10) is generally safer for cross-platform compatibility.

Why is my formula returning #VALUE! error?

This error usually occurs if one of the arguments is an invalid type or if the range contains error values like #N/A. Ensure all source cells contain valid text or numbers, and that you are using a supported version of Excel for TEXTJOIN.

Is there a way to join cells horizontally?

Yes, simply change the range reference in the formula to a horizontal row, such as A1:E1. The TEXTJOIN function treats both vertical and horizontal ranges identically, merging them left-to-right or top-to-bottom based on the layout.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More