Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Use Data Form to input, edit and delete records in Excel
  • Move chart to a separate worksheet in Excel
  • How to add Trendline to a chart in Excel
  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • How to Create Column Chart in Excel

References

  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • Count rows that contain specific values in Excel
  • MATCH function: Description, Usage, Syntax, Examples and Explanation
  • Complete List of Excel Lookup and Reference Functions, References and Examples
  • How to get address of last cell in range in Excel

Data Validations

  • Excel Data validation require unique number
  • How To Create Drop-down List in Excel
  • Excel Data validation exists in list
  • Excel Data validation must contain specific text
  • Prevent invalid data entering in specific cells

Count rows with at least n matching values

by

This tutorial shows how to Count rows with at least n matching values using the example below;

Formula

{=SUM(--(MMULT(--(criteria),TRANSPOSE(COLUMN(data)^0))>=N))}

Explanation

To count rows that contain specific values, you can use an array formula based on the MMULT, TRANSPOSE, COLUMN, and SUM functions. In the example shown, the formula in K6 is:

{=SUM(--(MMULT(--((data)<70),TRANSPOSE(COLUMN(data)^0))>=2))}

where data is the named range C5:I14.

Note this is an array formula and must be entered with control shift enter.

How this formula works

Working from the inside out, the logical criteria used in this formula is:

(data)<70

where data is the named range C5:I14. This generates a TRUE / FALSE result for every value in data, and the double negative coerces the TRUE FALSE values to 1 and 0 to yield an array like this:

{0,0,0,1,0,1,0;0,0,0,0,0,0,0;0,0,0,0,0,0,0;0,1,1,0,0,1,0;0,0,0,0,0,0,0;0,0,0,0,0,0,0;0,0,0,0,0,0,0;0,1,0,0,0,0,0;0,0,0,0,0,0,0;0,0,0,0,0,0,0}

Like the original data, this array is 10 rows by 7 columns (10 x 7) and goes into the MMULT function as array1. The next argument, array2 is created with:

TRANSPOSE(COLUMN(data)^0))

Here, the COLUMN function is used as a way to generate a numeric array of the right size, since matrix multiplication requires the column count in array1 (7) to equal the row count in array2.

The COLUMN function returns the 7-column array {3,4,5,6,7,8,9}. By raising this array to a power of zero, we end up with a 7 x 1 array like {1,1,1,1,1,1,1}, which TRANSPOSE changes to a 1 x 7 array like {1;1;1;1;1;1;1}.

MMULT then runs and returns a 10 x 1 array result {2;0;0;3;0;0;0;1;0;0}, which is processed with the logical expression >=2, resulting in an array of TRUE FALSE values:

{TRUE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}.

We again coerce TRUE FALSE to 1 and 0 with a double negative to get a final array inside SUM:

=SUM({1;0;0;1;0;0;0;0;0;0})

Which correctly returns 2, the number of names with at least 2 scores below 70.

Post navigation

Previous Post:

How to use Excel CHOOSE Function

Next Post:

Customize Ribbon In Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • Complete List of Excel Logical Functions, References and Examples
  • How to use IFS function in Excel
  • How to use Excel FALSE Function
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • OR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • YEARFRAC function: Description, Usage, Syntax, Examples and Explanation
  • List holidays between two dates in Excel
  • Convert Excel time to decimal seconds
  • Extract date from a date and time in Excel
  • Two ways to sum time over 30 minutes in Excel

Grouping

  • Running count group by n size in Excel
  • Group arbitrary text values in Excel
  • Group numbers with VLOOKUP in Excel
  • Calculate conditional mode with criteria in Excel
  • Map inputs to arbitrary values in Excel

General

  • Currency vs Accounting Format in Excel
  • Basic text sort formula in Excel
  • How to calculate percent of students absent in Excel
  • How to get original number from percent change in Excel
  • How to generate random date between two dates in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning