How to Use Excel IF and LARGE with SUBTOTAL Results
Question details
The user needs to identify the largest visible subtotal in a spreadsheet by combining IF, LARGE, and SUBTOTAL functions.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Filtering source values based on specific labels to dynamically extract the maximum subtotal among visible rows in a dataset.
- Observed behavior
- To retrieve the highest subtotal values conditionally, specific array filtering must be applied to evaluate criteria before processing the LARGE function.
Ensure your dataset contains relevant labels or criteria for the IF function to evaluate, and verify your software version, as older spreadsheet programs require special keystrokes for array formulas.
Use Dynamic Array Formulas (Modern Excel & WPS Spreadsheet)
For modern spreadsheet applications, you can use standard array formulas to filter and extract the largest subtotal without special keystrokes.
In modern spreadsheet applications, formula calculation engines natively support dynamic arrays. This allows you to nest conditional statements directly inside aggregation functions like LARGE without needing specialized array execution commands.
Determine the column containing your conditional labels (e.g., A2:A20) and the column containing your subtotal values (e.g., B2:B20).
Click on the blank cell where you want the largest subtotal value to be displayed.
Type the formula: =LARGE(IF(A2:A20="TargetLabel", B2:B20), 1). Replace "TargetLabel" with your specific criteria.
Press Enter. The dynamic array engine will automatically filter the subtotals matching your label and output the highest value.

Use Legacy Array Formulas (Older Versions)
If you are using older versions of Excel (prior to Microsoft 365), you must execute the calculation as an array formula using Ctrl+Shift+Enter.
Calculate Array Formulas Seamlessly with WPS Spreadsheet
WPS Spreadsheet provides robust native support for dynamic arrays and complex formula combinations like IF, LARGE, and SUBTOTAL. You can effortlessly calculate conditional maximums and process large datasets without worrying about legacy array shortcuts.
- 1. Open Your Workbook: Launch WPS Spreadsheet and open your dataset containing the subtotal values.
- 2. Enter the Formula: Select a blank cell and directly type the =LARGE(IF(...)) formula referencing your data criteria.
- 3. Execute Calculation: Press Enter to instantly process the dynamic array formula and display the largest subtotal result.

Frequently Asked Questions
When should I use Ctrl+Shift+Enter instead of just pressing Enter?
In older versions of Excel (prior to Microsoft 365), you must use Ctrl+Shift+Enter to execute array formulas like IF combined with LARGE. This shortcut instructs the software to evaluate multiple values in an array rather than a single cell. Modern versions natively support dynamic arrays using just the Enter key.
Can I use MAX instead of LARGE to find the highest subtotal?
Yes. If you strictly need the single highest value, using =MAX(IF(criteria_range=criteria, subtotal_range)) works perfectly. The LARGE function is preferred when you need the flexibility to find the Nth highest subtotal, such as the 2nd or 3rd largest value.
Why does my LARGE and IF combined formula return a #NUM! error?
The #NUM! error typically occurs if the filtered array is empty (meaning no data matched your IF criteria condition) or if the requested 'k' position (e.g., asking for the 5th largest value) is greater than the total number of matching items available in the filtered range.




