How to Subtract Excel Columns and Filter Results using Power Query or FILTER
Question details
The user needs to calculate the difference between an 'Online Credit' and an 'Online Debit' column, filter the results based on the calculated difference, and return only the date, transaction description, and the new difference value.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Processing a financial dataset to find specific transaction discrepancies and extracting only the relevant columns into a clean output.
- Observed behavior
- Looking for the most efficient method to combine column subtraction, row filtering, and column extraction without creating messy helper columns.
Format your source data as an official Excel Table (press Ctrl+T) so that both Power Query and dynamic array formulas can easily reference the column names automatically.
Use Power Query to Subtract and Filter (Recommended)
Power Query is the most robust method for this task, especially for large datasets, as it processes data efficiently in the background without slowing down the workbook.
Handling data transformation through Power Query keeps your spreadsheet clean and prevents formula-heavy performance issues.
Select any cell in your data table, go to the Data tab, and click 'From Table/Range' to open the Power Query Editor.
Select both the 'Online Credit' and 'Online Debit' columns, right-click the headers, choose 'Replace Values', and replace null or empty values with 0 to prevent calculation errors.
Go to the Add Column tab, click 'Custom Column', name it 'Difference', and enter the formula: [Online Credit] - [Online Debit].
Click the filter drop-down arrow on the new 'Difference' column and set your condition (e.g., less than zero, or does not equal zero).
Select only the Date, Transaction Description, and Difference columns, right-click the headers, and choose 'Remove Other Columns'. Finally, click 'Close & Load' on the Home tab to output the result.
Use the LET and FILTER Dynamic Array Functions
If you prefer a formula-based approach that updates instantly without requiring a refresh, combining LET, FILTER, and HSTACK is an excellent solution.
Process Dynamic Arrays and Formulas Seamlessly with WPS Spreadsheet
WPS Spreadsheet fully supports modern dynamic array functions like LET, FILTER, and HSTACK. You can effortlessly calculate, filter, and extract complex datasets in real-time.
- 1. Open your dataset: Launch WPS Spreadsheet and open your financial data file.
- 2. Apply dynamic arrays: Select your target cell and input your combination of LET and FILTER formulas to calculate and extract columns.
- 3. Analyze instantly: Hit Enter to instantly spill the calculated, filtered dataset directly onto your worksheet, updating dynamically as source data changes.

Frequently Asked Questions
Why do I get calculation errors when subtracting columns?
Errors usually occur when there are blank (null) cells or text values in the columns you are subtracting. In Power Query, always replace null values with '0' before applying a custom subtraction column.
Does the LET function create Named Ranges?
No. The variables assigned within a LET function are strictly local variables. They only exist inside that specific formula and will not appear in your workbook's Name Manager.
Which is better for filtering: Power Query or the FILTER function?
The FILTER function is better for smaller datasets where you need real-time, dynamic updates on the worksheet. Power Query is much better for large datasets (thousands of rows) because it handles the processing in the background, keeping your workbook fast and lightweight.




