How to Count the Letter X in Excel Cells Containing a Specific Word
Question details
The user needs to count occurrences of a specific character (the letter 'x') within a specific range of cells, but only for the rows where an associated column contains a specific target word ('Blaster').
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Performing conditional data analysis where a count is required across multiple columns based on a text criteria met in the first column.
- Observed behavior
- The user requires an accurate formula to evaluate multiple cell ranges simultaneously to return the total count of the letter 'x' matching the 'Blaster' row criteria.
Ensure your dataset is organized in a tabular format, and verify that the criteria range and the counting range cover the exact same number of rows to prevent formula calculation errors.
Use the SUMPRODUCT Function for Conditional Array Counting
The SUMPRODUCT function evaluates multiple array conditions simultaneously. This is the most reliable method as it is fully compatible with almost all versions of Excel and spreadsheet software.
SUMPRODUCT works by multiplying arrays of boolean values (TRUE/FALSE). When a cell in column A equals 'Blaster', it returns TRUE (1). When a cell in the adjacent range equals 'x', it also returns TRUE (1). The function multiplies these outcomes and sums the results to give you the total count.
Click on an empty cell where you want the final count to be displayed.
Type the formula =SUMPRODUCT((A2:A14="Blaster")*(B2:D14="x")). Adjust the range A2:A14 to match your criteria column and B2:D14 to match the grid where the 'x' characters are located.
Press the Enter key. The formula will automatically count all instances of 'x' that appear in rows containing 'Blaster'.
Use the SUM Function with Dynamic Arrays (Microsoft 365 / Excel 2021)
If you are using a modern version of Excel that supports dynamic arrays, you can use the standard SUM function to achieve the same result without needing legacy array shortcuts.
Perform Complex Data Calculations Easily with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas, including SUMPRODUCT and dynamic SUM conditional counts. It provides a highly intuitive interface to manage, analyze, and conditionally calculate your data without formatting issues.
- 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your data.
- 2. Select the destination cell: Click on a blank cell where the conditional count result should appear.
- 3. Apply the array formula: Enter the formula =SUMPRODUCT((A2:A14="Blaster")*(B2:D14="x")) tailored to your specific ranges.
- 4. Get instant results: Press Enter to execute the formula and instantly view your calculated count.

Frequently Asked Questions
Why does my SUMPRODUCT formula return a #VALUE! error?
This error typically occurs if the arrays within your formula do not have the same number of rows. Ensure that the criteria range (e.g., A2:A14) and the counting range (e.g., B2:D14) span the exact same starting and ending row numbers.
How can I count cells if the word 'Blaster' is part of a longer sentence?
If 'Blaster' is mixed with other text, you can use the ISNUMBER and SEARCH functions inside SUMPRODUCT. Modify the first part of your formula to read: ISNUMBER(SEARCH("Blaster", A2:A14)). This will return TRUE for any cell in the range containing the word.
Can I count multiple different characters conditionally?
Yes, you can use the plus (+) operator to apply OR logic between conditions. For example, to count both 'x' and 'y' conditionally, format your formula like this: =SUMPRODUCT((A2:A14="Blaster")*((B2:D14="x")+(B2:D14="y"))).




