Count Words Used in text

thisRow.Column1.split(" ").Sort().count().join(LineBreak())

This formula will read a paragraph of text and provide a sorted list in a column of all the words used. But I need to have it compress the listing of the words, so each one only appears once, but also gives me a count of how many times that word was used, ie don’t print “the” 5 times, just print “the” 1 time and display a 5 to show “the” was used 5 times

The Keywords example is helpful, but we don’t now what the Keywords are here.

Try this!

foreach(thisrow.column1.split(" ").unique(),
Withname(currentvalue, currentword, Concatenate(currentword, ": ",
thisrow.column1.split(" ").countif(currentvalue=currentword))))
2 Likes

Thanks very much- will do.

That worked! I added in a Sort() and a joinLineBreak(), and it’s perfect - thanks so much!!!

foreach(thisRow.Column1.split(" ").Sort().unique(),
Withname(currentvalue, currentword, Concatenate(currentword, ": “,
thisRow.Column1.split(” ").countif(currentvalue=currentword)))).join(LineBreak())

Gold Star for you Billy_Jackson!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.