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

Data Analysis

  • How to Create Column Chart in Excel
  • How to sum a total in multiple Excel tables
  • Conditional Formatting New Rule with Formulas in Excel
  • How To Create Pareto Chart in Excel
  • How to create Checklist in Excel

References

  • Count rows with at least n matching values
  • Create hyperlink with VLOOKUP in Excel
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • How to use Excel MMULT Function
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Excel Data validation no punctuation
  • Excel Data validation don’t exceed total
  • Excel Data validation with conditional list
  • Excel Data validation exists in list
  • Excel Data validation date in next 30 days

How to count specific characters in a cell in Excel

by

To count how many times a specific character appears in a cell, you can use a formula based on the SUBSTITUTE and LEN functions.

Formula

=LEN(A1)-LEN(SUBSTITUTE(A1,"a",""))

Explanation

 

In the example, the active cell contains this formula:

=LEN(B3)-LEN(SUBSTITUTE(B3,C3,""))

How this formula works

This formula works by using SUBSTITUTE to first remove all of the characters being counted in the source text. Then the length of the text (with the character removed) is subtracted from the length of the original text. The result is the number of characters that were removed with SUBSTITUTE, which is equal to the count of those characters.

Worked Example:   Find longest string in column in Excel

Upper and lower case

SUBSTITUTE is a case sensitive function, so it will match case when running a substitution. If you need to count both upper and lower case occurrences of a specific character, use the UPPER function inside SUBSTITUTE to convert the text to uppercase before running the substitution. Then supply an uppercase character as the text that’s being substituted like this:

=LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),"A",""))

Post navigation

Previous Post:

Put names into proper case — Manipulating NAMES in Excel

Next Post:

Create One-dimensional and Two-dimensional Array

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

  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel
  • How to use Excel NOT Function
  • NOT function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Check If Two Dates are same month in Excel
  • How to calculate next scheduled event in Excel
  • Series of dates by day
  • Get first Monday before any date in Excel
  • Calculate date overlap in days in Excel

Grouping

  • Map text to numbers in Excel
  • Categorize text with keywords in Excel
  • Group arbitrary text values in Excel
  • Running count group by n size in Excel
  • Map inputs to arbitrary values in Excel

General

  • Subtotal invoices by age in Excel
  • 231 Keyboard Shortcut Keys In Excel
  • Create dynamic workbook reference to another workbook in Excel
  • How to add sequential row numbers to a set of data in Excel
  • Lock Cells in a Worksheet Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning