Forum Discussion

YYHoe's avatar
YYHoe
Copper Contributor
Jul 06, 2022
Solved

Sorting out and counting text strings in a table

I have attached a table extracted from a power query.  I want to turn it (B2:H21) into a first column listing down unique strings in alphabetical order (ignoring nul cells) and a second column showing the count any strings that are replicates.  Any simple and elegant trick from Excel experts here?

  • YYHoe That would involve unpivotting the data, clean-up a bit and then group (and count) and sort. An example is included in the attached file. I couldn't continue with your query as it connect to an source that was not in the workbook. But I created a new (stand-alone) table from the one in Sheet1 and connected PQ to that one. The end result is in sheet PQ.

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    YYHoe That would involve unpivotting the data, clean-up a bit and then group (and count) and sort. An example is included in the attached file. I couldn't continue with your query as it connect to an source that was not in the workbook. But I created a new (stand-alone) table from the one in Sheet1 and connected PQ to that one. The end result is in sheet PQ.

    • YYHoe's avatar
      YYHoe
      Copper Contributor
      Thank you very much, Riny. Spot on!!!

Resources