How to Count Specific Letters Like E and L in Excel Columns
Question details
The user needs to count the number of times specific letters, such as 'E' and 'L', appear in columns like B and C, and wants to know if they should use TEXTBEFORE combined with COUNTIF.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Counting the exact occurrences of specific text values or characters in designated spreadsheet columns.
- Observed behavior
- The user is attempting to establish a count for specific letters and is unsure if nesting TEXTBEFORE with COUNTIF is the correct formula approach.
Determine if the letters 'E' and 'L' occupy the entire cell (e.g., the cell just says 'E') or if they are embedded within a longer text string, as this changes the required formula.
Use COUNTIFS to Count Exact Cell Matches
This is the most straightforward method when the cells contain exactly the letter 'E' or 'L' and nothing else.
The COUNTIF and COUNTIFS functions are designed to count the number of cells that meet a single or multiple criteria. There is no need to use TEXTBEFORE if the cell only contains the target letter.
Click on an empty cell where you want the final count result to be displayed.
Type the formula =COUNTIFS(B$2:B$6,"L") into the formula bar to count all occurrences of the letter 'L' in the range B2 to B6.
Press Enter to see the result. You can repeat this process in another cell using =COUNTIFS(B$2:B$6,"E") to count occurrences for the letter 'E'.
Count Letters Embedded in Text Using Wildcards
If the letters 'E' and 'L' are part of a longer text string, you don't necessarily need TEXTBEFORE. You can simply use wildcards with the COUNTIF function.
Count Data Easily with WPS Spreadsheet
WPS Spreadsheet fully supports standard Excel formulas like COUNTIF and COUNTIFS, allowing you to seamlessly calculate and analyze your data. It offers full compatibility with Microsoft Excel files and features a highly intuitive interface.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing the columns you want to count.
- 2. Access the Formula tab: Select the cell for your result and navigate to the 'Formulas' tab on the top ribbon.
- 3. Insert the COUNTIFS function: Click 'Insert Function', search for 'COUNTIFS', and input your desired range and criteria (e.g., "E").
- 4. Calculate the result: Click 'OK' to instantly calculate the occurrences of the letter in your selected column.

Frequently Asked Questions
Can I combine TEXTBEFORE and COUNTIF in Excel?
While you can nest functions, it is rarely necessary for simple counting. If you need to count based on text before a specific character, it's often easier to use an array formula or combine wildcards (like '*') with the COUNTIF function.
How do I count multiple different letters at the same time?
You can add multiple COUNTIF functions together in one formula. For example, use =COUNTIF(B2:B6,"E") + COUNTIF(B2:B6,"L") to get the combined total count of both letters within the specified range.
Are COUNTIF and COUNTIFS case-sensitive?
No, COUNTIF and COUNTIFS treat uppercase and lowercase letters identically. To perform a strictly case-sensitive count, you would need to use a combination of the SUMPRODUCT and EXACT functions.




