Excel Formula to Count Combinations Where Selected Values Exceed 2
Question details
The user needs a formula or data model that counts rows where every value in each selected combination of three or four categories is greater than 2, then identifies the combinations with the highest counts.

- Product
- Microsoft Excel or WPS Spreadsheets with Excel-compatible formulas
- Device & OS
- not provided
- Scenario
- Category values are arranged in columns, and the user wants to evaluate three-column and four-column combinations against the condition that every selected value exceeds 2.
- Observed behavior
- The required category layout, row range, combination list, and expected output structure have not been provided, so a reliable single dynamic formula cannot be tailored to the data yet.
Confirm which columns contain the categories, the first and last data rows, and whether the result should include only three-category combinations, four-category combinations, or both. Create a small output table listing each combination, such as ABC, ABD, ACD, BCD, and ABCD.
Count each category combination with COUNTIFS
Use this method when the category columns and combinations are known; it is reliable in both current Excel and WPS Spreadsheets.
Assume category values are in A2:D100, with category names in row 1. Each COUNTIFS formula checks that every selected column in a combination contains a value greater than 2. Adjust the range to match the actual dataset.
For four category columns, the three-category combinations are ABC, ABD, ACD, and BCD. The four-category combination is ABCD.
In F2:F6, enter ABC, ABD, ACD, BCD, and ABCD. Put Count in G1 and Highest combination in the adjacent output area.
In G2, select the cell and enter =COUNTIFS($A$2:$A$100,">2",$B$2:$B$100,">2",$C$2:$C$100,">2"). Press Enter.
In G3:G6, enter these formulas: G3 =COUNTIFS($A$2:$A$100,">2",$B$2:$B$100,">2",$D$2:$D$100,">2"); G4 =COUNTIFS($A$2:$A$100,">2",$C$2:$C$100,">2",$D$2:$D$100,">2"); G5 =COUNTIFS($B$2:$B$100,">2",$C$2:$C$100,">2",$D$2:$D$100,">2"); G6 =COUNTIFS($A$2:$A$100,">2",$B$2:$B$100,">2",$C$2:$C$100,">2",$D$2:$D$100,">2").
To return the highest count, enter =MAX(G2:G6). To return the matching combination, enter =INDEX(F2:F6,MATCH(MAX(G2:G6),G2:G6,0)).
Rank the calculated combinations from highest to lowest
Use this option after calculating each combination when the output should display every combination in ranked order.
Count and Rank Excel-Compatible Combinations in WPS Spreadsheets
WPS Spreadsheets can use COUNTIFS to test whether every selected category value exceeds 2, then use MAX, INDEX, MATCH, FILTER, or SORTBY to identify and rank the strongest combinations. The workflow is suitable for Excel-compatible workbooks and can be adjusted to any row range.
- 1. Open the workbook: Launch WPS Office, choose Spreadsheet, and open the Excel-compatible .xlsx file containing the category data.
- 2. Prepare the output table: On a blank area or worksheet, list each required combination and reserve a neighboring column for its count.
- 3. Enter the COUNTIFS formulas: Select each count cell and use COUNTIFS with a ">2" criterion for every category column in that combination.
- 4. Find and rank the results: Use MAX and INDEX/MATCH to identify the highest result, or use SORTBY to sort the combination table from highest to lowest.

Frequently Asked Questions
How do I count rows where three selected Excel columns are all greater than 2?
Use COUNTIFS with a ">2" criterion for each selected column. For columns A, B, and C, enter =COUNTIFS(A2:A100,">2",B2:B100,">2",C2:C100,">2").
How can I test all three-column combinations from four category columns?
Create separate COUNTIFS formulas for ABC, ABD, ACD, and BCD. Use the corresponding three column ranges in each formula, then place the results beside the combination names.
How do I include the combination of all four categories?
Add a fourth COUNTIFS range and criterion: =COUNTIFS(A2:A100,">2",B2:B100,">2",C2:C100,">2",D2:D100,">2"). This counts rows where all four values exceed 2.
How can I return the combination with the highest count?
If combination names are in F2:F6 and counts are in G2:G6, use =INDEX(F2:F6,MATCH(MAX(G2:G6),G2:G6,0)). Use FILTER with MAX if you need every combination tied for first place.
Why might my combination count be zero?
Check that the category ranges start and end on the same rows, contain numeric values rather than text, and use the correct threshold. Values equal to 2 do not qualify because the condition is strictly greater than 2.




