How to Compare Two Columns with Dynamic Array Spilling in Excel
Question details
The user wants to compare two large columns and extract only the differing values using a single dynamic array formula, avoiding the need to manually fill or drag the formula down thousands of rows.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Comparing two large datasets or columns to find discrepancies quickly.
- Observed behavior
- The goal is to have the results automatically populate (spill) into the adjacent rows and columns from a single cell entry.
Ensure you are using a version of Excel that supports dynamic arrays (Microsoft 365 or Office 2021). Also, verify that the destination range is completely empty to prevent #SPILL! errors.
Use the IF Function with Dynamic Arrays to Compare Columns
Leverage Excel's dynamic array feature to evaluate entire columns at once, outputting differences instantly without dragging.
Dynamic arrays allow a formula to return multiple values that automatically spill into neighboring cells. This eliminates the need to manually drag fill handles down thousands of rows.
Ensure that the cells where you want the results to appear (e.g., H2:I41100) are entirely blank, without any hidden spaces or text.
Click on the top-left cell of your intended destination range, such as cell H2.
Type the formula =IF(D2:D41100=E2:E41100,"",D2:E41100) into the formula bar and press Enter.
The formula will automatically spill the differing values across the required rows and columns. Rows that perfectly match will appear blank.

Compare Columns Quickly with WPS Spreadsheet
WPS Spreadsheet fully supports dynamic array formulas, allowing you to easily compare large datasets and automate data extraction without tedious manual work. It is highly compatible with Microsoft Excel formulas.
- 1. Open your spreadsheet: Launch WPS Office and open your workbook containing the data.
- 2. Prepare output columns: Ensure the output columns (e.g., columns H and I) are completely empty to allow the formula to expand.
- 3. Input the array formula: Select the top cell of your output column (e.g., H2) and input your formula: =IF(D2:D41100=E2:E41100,"",D2:E41100).
- 4. Execute the formula: Press Enter to instantly spill the calculated data into the neighboring rows and columns.

Frequently Asked Questions
Why am I getting a #SPILL! error in Excel?
A #SPILL! error occurs when the dynamic array formula tries to populate multiple cells, but one or more cells in the destination range already contain data, spaces, or hidden characters. Clear the destination range completely to resolve this.
Do dynamic array formulas work in older versions of Excel?
No, dynamic array spilling is only supported in Microsoft 365, Excel 2021, and modern spreadsheet alternatives like WPS Office. Older versions like Excel 2016 or 2019 require traditional Ctrl+Shift+Enter array formulas, which do not spill automatically.
How do I edit a spilled array formula?
You can only edit a spilled array formula from the top-left cell where it was originally entered. The other cells in the spill range will appear grayed out in the formula bar and cannot be modified directly.
Can I use dynamic arrays with other functions?
Yes, dynamic arrays work seamlessly with many functions, including FILTER, SORT, UNIQUE, XLOOKUP, and VLOOKUP, allowing you to build highly responsive and automated data dashboards.




