How to Combine Multi-Line Excel Transactions Automatically
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.

- 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.
Ensure your dataset is structured consistently, with transaction dates in one specific column and the multi-line merchant details in another column.
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.
Click on an empty cell in a new column next to your first row of data (for example, cell C2).
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.
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.
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.

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. Open your data file: Launch WPS Spreadsheet and open the CSV or XLSX file containing your bank transactions.
- 2. Insert the combination formula: Type the nested IF formula in a helper column to automatically join the multi-row merchant details.
- 3. Format the results: Highlight the formula column and click the 'Wrap Text' button in the Home tab to properly display the combined lines.

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.




