0
votes

I am trying in EXCEL to count the number of equal signs present in a range of cells. They are just text to me. I am using the EXCEL function COUNTIF(), but it seems that EXCEL always recognize the equal signs as a formula. Thsi is the formula I am typing: =COUNTIF(A1:M1;"="). I also tried an apostrophe before the equal sign , but it seems not to work neither.

=COUNTIF(A1:M1;"=")

I expect to obtain in a cell the number of equal signs in a given range of cells

2
Have you formatted cells as text yet?JvdV
You've got two good answers, but I'm not sure which one you want - e.g. if your had two cells containing "=" and "==", would the answer be two or three?Tom Sharpe
What is the C# tie in to this question? Are you looking for a C# solution? If not, what about a UDF?Hambone

2 Answers

0
votes

You can do it by substituting out the char, measuring the string length before and after the substitution, see this article at ExcelJet.

Try

=SUMPRODUCT(LEN(A1:M1)-LEN(SUBSTITUTE(A1:M1,"=","")))
0
votes

Please try this COUNTIF function.

=COUNTIF(A1:M1,"*=*")