Function Problems

How to Combine Multi-Line Excel Transactions Automatically

Amos GikundaAmos Gikunda Oct 20, 2026 869 views

Question details

The user needs to merge bank transaction records that span across two or three rows into a single cell, using a formula that identifies whether the rows below contain dates.

How to Combine Multi-Line Excel Transactions Automatically
Product
Excel
Device & OS
not provided
Scenario
Cleaning up and organizing exported bank transactions where a single transaction's details are split across multiple consecutive rows.
Observed behavior
Merchant details are spread across separate rows, requiring a method to automatically combine them into one cell with line breaks while processing thousands of records.
Before you start

Ensure your dataset is structured consistently, with transaction dates in one specific column and the multi-line merchant details in another column.

Solution 1Recommended

Use a Nested IF and CHAR(10) Formula

Apply a logic-based formula that checks for empty date cells in the rows below and combines the corresponding merchant text using line breaks.

This formula uses the IF and AND functions to evaluate whether the cells in the date column directly below the current row are empty. If they are blank, it assumes the merchant details in those rows belong to the current transaction. The CHAR(10) function is used to insert a line break between the combined text strings.

1
Select an empty cell

Click on an empty cell in a new column next to your first row of data (for example, cell C2).

2
Enter the combination formula

Type the following formula: =IF(A2="","",IF(AND(A3="",A4=""),B2&CHAR(10)&B3&CHAR(10)&B4,IF(A3="",B2&CHAR(10)&B3,B2))). This assumes dates are in column A and merchant details are in column B.

3
Apply to the entire column

Press Enter, then click the bottom-right corner of cell C2 and drag the fill handle down to copy the formula for all transaction rows.

4
Enable Wrap Text

Select the entire column containing your new formulas, navigate to the Home tab on the top ribbon, and click 'Wrap Text' to make the line breaks visible.

Use a Nested IF and CHAR(10) Formula
Adjust Cell References: If your dates are in column D and merchant names are in column E, update the formula accordingly: =IF(D2="","",IF(AND(D3="",D4=""),E2&CHAR(10)&E3&CHAR(10)&E4,IF(D3="",E2&CHAR(10)&E3,E2)))
Efficient Data Cleaning

Combine Complex Transaction Data Easily in WPS Spreadsheet

WPS Spreadsheet provides robust formula processing to seamlessly manage messy, multi-line bank data. Use advanced text functions to clean thousands of rows in seconds.

  1. 1. Open your data file: Launch WPS Spreadsheet and open the CSV or XLSX file containing your bank transactions.
  2. 2. Insert the combination formula: Type the nested IF formula in a helper column to automatically join the multi-row merchant details.
  3. 3. Format the results: Highlight the formula column and click the 'Wrap Text' button in the Home tab to properly display the combined lines.
Fully compatible with Microsoft Excel formulas, including IF, AND, and CHAR.One-click 'Wrap Text' formatting for clear data visualization.Lightweight performance ensures smooth scrolling even with thousands of transaction rows.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my combination formula returning a completely blank cell?

A blank result usually occurs when the referenced date cell (e.g., A2 or D2) is empty. The formula's first condition checks if the date cell is blank and returns an empty string if true. Double-check that your cell references accurately point to the column containing your transaction dates.

What does CHAR(10) do in this Excel formula?

CHAR(10) is a function that returns a line break character. When combining text from multiple cells using the ampersand (&), adding CHAR(10) forces the next piece of text to start on a new line within the same cell. You must enable 'Wrap Text' to see the effect.

How can I adjust the formula if a transaction spans four rows instead of three?

You need to add another nested IF condition to check if the next three rows are blank. For example, include AND(A3="",A4="",A5="") and append the fourth cell using &CHAR(10)&B5. The nesting must be prioritized from the largest group of blank rows down to the smallest.