Counting character occurrences (Excel)

Solved
identifiant-comment Posted messages 351 Status Member -  
 toy -
Hello,

In Excel 2003, I want to count the number of occurrences of a string of characters in a given cell.
I tried to do it with SEARCH, but that’s clearly not the right solution.
Could someone please help me?

Thank you!
Configuration: Windows XP Internet Explorer 7.0

12 answers

  1. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
     
    Hello,

    I’m not sure if I understood everything correctly,

    If you want to count the number of characters in cell A1, the formula is

    =LEN(A1)

    To count the number of R’s for example, the formula is

    =SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,"R",""))))



    Or to count the characters different from R

    =LEN(SUBSTITUTE(A1,"R",""))



    A+
    63
    1. helmy53
       
      I also used the formula to count the number of "1"s in a text cell. It works very well, thank you.
      0
    2. Younesse
       
      Thank you, great job.
      0
    3. mm
       
      Sommeprod is useless, isn’t it?
      0
    4. toy
       
      Thank you for the info, it saved my life.
      0