Forum Discussion

Bielalve's avatar
Bielalve
Copper Contributor
Aug 09, 2022
Solved

Count different texts

Basically I'm working only with column A, where I have several different terms, but they repeat in different amounts. I need to know how many times each of these terms appeared in column A, is there any practical way to do this? Attached just for example, but the actual list is very extense and it would take a lot of time to do it manually

 

Excel 2016

  • Hi Bielalve 

    Recentily Microsoft upgrade to Excel's formula language to support https://support.microsoft.com/en-us/office/dynamic-array-formulas-and-spilled-array-behavior-205c6b06-03ba-4151-89a1-87a7eb36e531.

    Now you cold use this simple way to do this

     

     

     

    =UNIQUE(A2:A1812) & " " &COUNTIF(A2:A1812;UNIQUE(A2:A1812))  & "x"

     

    or if you need filter nulable results try this other form

     

     

    =LET(
               rangecells;A2:A1812;
               uniqList; UNIQUE(rangecells);
               filteredList; FILTER(uniqList;uniqList<>"");
               return; filteredList & " " &COUNTIF(rangecells;filteredList)  & "x";
     return
    )

     

     

     

    Hope it help you

     

7 Replies

  • Harun24HR's avatar
    Harun24HR
    Silver Contributor

    Bielalve Use CHOOSE() with UNIQUE() and COUNTIF() for one go. All below solution are included to attach sample file.

    =CHOOSE({1,2},UNIQUE(A2:A8),COUNTIF(A2:A8,UNIQUE(A2:A8))& "x")

    To show result in same cell use-

    =UNIQUE(A2:A8)&" "&COUNTIF(A2:A8,UNIQUE(A2:A8))&"x"

    For LAMBDA() approach to use custom function via Name Manager, try-

    =LAMBDA(inRng,CHOOSE({1,2},UNIQUE(inRng),COUNTIF(inRng,UNIQUE(inRng))& "x"))(A2:A8)

     

    • Icassatti's avatar
      Icassatti
      Brass Contributor
      Man i learned more with your solution. I never use choose function to combine many arrays, like you did. Thank you for put your contribution.
  • Icassatti's avatar
    Icassatti
    Brass Contributor

    Hi Bielalve 

    Recentily Microsoft upgrade to Excel's formula language to support https://support.microsoft.com/en-us/office/dynamic-array-formulas-and-spilled-array-behavior-205c6b06-03ba-4151-89a1-87a7eb36e531.

    Now you cold use this simple way to do this

     

     

     

    =UNIQUE(A2:A1812) & " " &COUNTIF(A2:A1812;UNIQUE(A2:A1812))  & "x"

     

    or if you need filter nulable results try this other form

     

     

    =LET(
               rangecells;A2:A1812;
               uniqList; UNIQUE(rangecells);
               filteredList; FILTER(uniqList;uniqList<>"");
               return; filteredList & " " &COUNTIF(rangecells;filteredList)  & "x";
     return
    )

     

     

     

    Hope it help you

     

  • Bielalve 

    =COUNT(SEARCH(", "&C3&", ",", "&$A$2:$A$18&", "))

    You can try this formula. Enter the formula with ctrl+shift+enter since you don't work with Office365 or 2021.

    • Bielalve's avatar
      Bielalve
      Copper Contributor

      OliverScheurich 

      For some reason I can't make the formula work, it just returns #name

      I'm using Office365 at home

       

      • OliverScheurich's avatar
        OliverScheurich
        Gold Contributor

        Bielalve 

        Do you work with the english version of Excel? Otherwise you would have to translate the formula. You can open the attached file and the result is shown with the formula translated into your language.