Skip to main content

Count cells that contain specific text with case sensitive

Normally, applying standard functions like COUNTIF or COUNTIFS can’t handle case sensitive. To count cells that contain specific text with case sensitive (exactly match the case text in specified cells), you can apply the combination of the SUMPRODUCT, ISNUMBER and the FIND functions to get it done. In this tutorial, you will learn how to use this formula in details to count the number of cells that contains specific text with case sensitive in a range in Excel.


How to count cells that contain specific text with case sensitive

Please do as follows to count the number of cells that contains specific text with case sensitive in a range in Excel.

Generic Formula

=SUMPRODUCT(--ISNUMBER(FIND(criteria,criteria_range)))

Arguments

Criteria (required): The text or text string you want to count cells based on;

Criteria_range (required): The range in which you want to count cells with case sensitive.

How to use this formula?

As the below screenshot shown, to count the number of cells in range B3:B9 that contain the text in D3:D5 with case sensitive, please do as follows to get it done.

1. Select a blank cell to output the result (here I select E3).

2. Enter the below formula into it and press the Enter key. Select the result cell, and then drag its AutoFill Handle over the below cells to apply the formula.

=SUMPRODUCT(--ISNUMBER(FIND(D3,$B$3:$B$9)))

How these formulas work?

=SUMPRODUCT(--ISNUMBER(FIND(D3,B3:B9)))

  • 1. FIND(D3,B3:B9): The FIND function is always case-sensitive. It checks for whether the value (“KTE”) in D3 existing in the specified range (B3:B9), and returns an array: {1,#VALUE!, #VALUE!, #VALUE!, #VALUE!,1, #VALUE!}.
    In this array, each number 1 represents the corresponding cell in range B3:B9 containing “KTE”, and each #VALUE indicates a cell in range B3:B9 does not contain “KTE”.
  • 2. ISNUMBER{1,#VALUE!, #VALUE!, #VALUE!, #VALUE!,1, #VALUE!}: The ISNUMBER function returns TURE if meeting numbers in the array, and returns FALSE if meeting errors. Here returns the result as {TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE}.
  • 3. --{TRUE,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE }: These two minus signs convert “TRUE” into 1 and convert “FALSE” into 0. Here you will get a new array as {1;0;0;0;0;1;0}.
  • 4. =SUMPRODUCT{1;0;0;0;0;1;0}: The SUMPRODUCT sums all number in the array and returns the final result as 2 in this case.

Related functions

Excel SUMPRODUCT function
The Excel COUNTBLANK function can be used to multiply two or more columns or arrays together, and then get the sum of products.

Excel ISNUMBER function
The Excel ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not.

Excel FIND function
The Excel FIND function is used to find a string within another string, and returns the starting position of the string inside another one.


Related formulas

Count cells that begin or end with specific text
This article is going to show you how to count cells that begin or end with specific text in a range in Excel with the COUNTIF function.

Count Blank/Nonblank Cells
This article explains formulas to count the number of blank and nonblank cells in a range in Excel.

Count Cells That Contain Either X Or Y
this tutorial is going to show you how to apply a formula based on the SUMPRODUCT function in details to count the number of cells in a specific range that contain either x or y in Excel.

Count how many cells contain errors
This tutorial shows how to count the number of cells that contains errors (any kind of errors, such as #N/A error, #VALUE! error or #DIV/0! error) in a specified range in Excel.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations