How to Simplify Complex SUMIFS Criteria with LAMBDA in Excel
Question details
The user needs to simplify multiple complex SUMIFS formulas that summarize structured-table data across various dimensions (date, class, type, and different amount fields) by creating a reusable LAMBDA function.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Summarizing structured-table data using multiple criteria combinations, such as four type classifications, ten classes, and three distinct amount fields.
- Observed behavior
- Standard SUMIFS formulas become overly long and difficult to manage, requiring a custom function approach for better readability and reuse.
Before designing your LAMBDA function, explicitly map out your complete table structure, exact criteria combinations, and the specific amount columns you need to aggregate to ensure the function handles all variations.
Create a Custom LAMBDA Function to Wrap Repetitive SUMIFS
Define a custom function in the Name Manager using LAMBDA to replace repetitive SUMIFS arguments, allowing you to pass only the variable criteria.
A reliable custom formula requires defining all input parameters (e.g., date range, class, type) and embedding the calculation logic (the SUMIFS formula) within a LAMBDA function.
Because simplified data can produce simplified answers that fail on complex datasets, ensure your function structure accounts for the four Type classifications, ten Classes, and three amount columns.
Determine the inputs your formula will need. For example: start_date, end_date, item_class, and item_type.
Go to the Formulas tab on the ribbon and click on Name Manager. Click New to create a custom name (e.g., 'SummaryCalc').
In the 'Refers to' box, define your logic. Example: =LAMBDA(start_date, end_date, item_class, item_type, SUMIFS(Table[Amount1], Table[Date], ">="&start_date, Table[Date], "<="&end_date, Table[Class], item_class, Table[Type], item_type))
Save the name and close the Name Manager. You can now use =SummaryCalc(A2, B2, "Class 1", "Type A") directly in your worksheet cells.
Streamline Complex Data Aggregation with WPS Spreadsheet
WPS Spreadsheet provides powerful formula capabilities, including an advanced Name Manager and robust array calculation support, allowing you to easily handle complex SUMIFS and conditional data analysis.
- 1. Open Your Structured Data: Launch WPS Spreadsheet and open your existing data table containing the classes, types, and amount fields.
- 2. Access Formula Management: Navigate to the Formulas tab and select Name Manager to start defining your custom formulas.
- 3. Define Reusable Logic: Input your simplified formula structure to act as a unified wrapper for your multiple SUMIFS queries.
- 4. Apply and Summarize: Call your named formula across your summary table to instantly aggregate data by your defined date, class, and type criteria.

Frequently Asked Questions
Why should I use LAMBDA instead of standard SUMIFS functions?
LAMBDA allows you to create a custom, reusable function. Instead of copying long, complex SUMIFS formulas with multiple repetitive criteria ranges (like date boundaries and classifications), you write the logic once in the Name Manager and call it with a short, readable name in your cells.
Can I use structured table references inside a LAMBDA function?
Yes, you can include structured table references (e.g., Table1[Amount]) within the calculation portion of your LAMBDA formula. This ensures that your SUMIFS logic remains dynamic and automatically adjusts as new rows are added to the table.
What if my custom function returns a #NAME? or #CALC! error?
A #NAME? error typically means the function was not saved correctly in the Name Manager or the formula name is misspelled in the cell. A #CALC! error usually indicates an issue with nested arrays or invalid criteria combinations within the underlying SUMIFS logic. Ensure your dataset structure is accurately mapped in the formula.




