Home » excel » Excel: Counting multiple characters by cell in range

Excel: Counting multiple characters by cell in range

Posted by: admin May 14, 2020 Leave a comment


I have a range as A:A since the amount of records changes. This range contains “x” in each cell which corresponds to how many projects were completed in that time. Therefore, a single cell may be entered as “x”, “xxx”, or “x x x”. I need the number of occurrences of “x” or “X” for that matter.

My current formula is =COUNTIFS(A:A,"x*",I:I,"Weekly*")I have tried altering this formula but can’t get the proper result as some cells contain more than one “x”. Thanks.

How to&Answers:

Substitute x & X with a blank value and then count & sum the difference. Depending on your version of excel, you may need to confirm formula with CTRL + SHIFT + ENTER


A cleaner way to handle lower case and uppercase values would just be to convert the entire string to uppercase and then only replace your uppercase values (X)



i have use a helper column. Modify and try the below:

Formula in Helper Column:


Formula to get the total:


enter image description here


Assuming that Column A only contains “X”s, and no other data, then the simplest method – if you have Office-365 or Office-2019 is to use Concat to turn the column into 1 giant string, then count the length:


If you don’t have Office-365 or Office-2019, then you can’t use the Concat function — as such, you will need to use an Array Formula to add the lengths:


(Using SUMPRODUCT instead of SUM means that we can press Enter as a normal formula, and everything inside the SUMPRODUCT is treated as an Array Formula, instead of having to press Ctrl+Shift+Enter)

As BigBen has pointed out, you have said that there are sometimes spaces in there. You have 2 ways to deal with this: either SUBSTUTUTE out the Spaces, or SUBSTITUTE out the Xs and take the difference


(The LOWER is needed, because SUBSTITUTE is Case Sensitive: =SUBSTITUTE("|XxX|","x") gives |XX|, not ||)