How to Use SUMIFS Formula for Debit or Credit Transactions in Excel
Question details
The user needs to calculate the total transaction amount for a selected account, but only when the transaction type is specifically labeled as 'Debit' or 'Credit'.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Filtering and summing financial ledger data conditionally based on multiple specific text criteria within a single column.
- Observed behavior
- The user requires an accurate formula syntax to evaluate multiple criteria using OR logic ('Debit' OR 'Credit') and optionally output a blank cell instead of a zero if there are no matching results.
Ensure that the ranges for your amounts, account criteria, and transaction types contain the exact same number of rows to prevent #VALUE! errors in your formulas.
Use SUMIFS with an Array of Criteria
Combine the SUM and SUMIFS functions using an array constant to calculate totals for multiple conditions like 'Debit' or 'Credit' simultaneously.
The standard SUMIFS function usually operates with AND logic. By wrapping SUMIFS inside a SUM function and passing an array of criteria, you can force it to evaluate using OR logic, summing amounts for both transaction types at once.
Click on the cell where you want the calculated total amount to be displayed.
Type the formula: =SUM(SUMIFS($U$60:$U$600,$R$60:$R$600,G9,$V$60:$V$600,{"Debit","Credit"}))
Press Enter to execute the formula. It will sum all amounts in column U where column R matches the value in G9, and column V is either 'Debit' or 'Credit'.

Wrap the Formula in an IF Statement to Hide Zeros
Keep your financial reports clean by returning a blank cell instead of a 0 when no debit or credit transactions match the criteria.
Alternative Method: Using the SUMPRODUCT Function
Use SUMPRODUCT as a robust alternative that handles array calculations natively without requiring special array entry.
Manage Your Debit and Credit Ledgers Seamlessly with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas, SUMIFS, and SUMPRODUCT, allowing you to manage your financial records and calculate transactions with ease. The interface is highly intuitive, making data analysis efficient for both beginners and experts.
- 1. Open your ledger: Launch WPS Spreadsheet and open your financial workbook containing the account and transaction data.
- 2. Select the target cell: Click on the specific cell where you wish to calculate the filtered account total.
- 3. Input the financial formula: Type in your chosen =SUM(SUMIFS(...)) formula exactly as you would in Microsoft Excel.
- 4. Calculate instantly: Press Enter to instantly process the data and display your accurate debit and credit totals.

Frequently Asked Questions
Why does my SUMIFS formula return a #VALUE! error?
This error most commonly occurs when your criteria ranges and sum range do not contain the same number of rows and columns. Ensure that ranges like $U$60:$U$600 and $R$60:$R$600 align perfectly in their start and end points.
Can I use the standard SUMIF function instead of SUMIFS for this?
The standard SUMIF function is designed to handle only a single condition. Because you need to check both the account identifier and multiple transaction types ('Debit' or 'Credit'), you must use SUMIFS or SUMPRODUCT.
Are the text criteria in the SUMIFS formula case-sensitive?
No, functions like SUMIFS and SUMPRODUCT in spreadsheets are not case-sensitive. The text strings 'Debit', 'DEBIT', and 'debit' will all be evaluated identically and included in the total.




