Hello,
I want to count # of words used in a query. See attachment.
Desired result is in Column D, which should count sample set of words that are in column c which is compared against column a, else put -
Thanks
Hello,
I want to count # of words used in a query. See attachment.
Desired result is in Column D, which should count sample set of words that are in column c which is compared against column a, else put -
Thanks
either of these will return a 1 or 0 but that is all, if you have for example, wolf twice in the cell both will still return 1.
=IF(ISNUMBER(SEARCH(C2,$A$2)),1,0)
=COUNT(SEARCH(C2,$A$2))
Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
Sam Capricci
Hi Sam,
Yes your formula works but my example was bad. i have re-uploaded. Cell A2 is the default. desired result in cell d5 should be 2, as i have used cat two times in cell a2. I tried your formula and it returned only 1.
appreciate any help in advance
If you want to get the total of the lookup words try this.
Formula:
Please Login or Register to view this content.
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Hi All, I'm looking for total count of words in column c by row, not the aggregate, as you have referneced.
Below is desired result:
Word
wolf 1
dog 1
dogs 1
cat 2
cats 1
jumps 0
Hi,
Will there be "Line Feeds" with No Space in your Actual data just like your sample in Post #3?
Yes there can be line breaks within data for example:
1-10
the wolf jumped over the cat dog and dogs
cat
cats
lions
Then this will give you the separate word counts as you require.
For your uploaded sample, in D2 copied down:
Formula:
Please Login or Register to view this content.
See attached.
another way
=SUMPRODUCT(COUNTIF(C2,TRIM(MID(SUBSTITUTE(SUBSTITUTE(A$2,CHAR(10)," ")," ",REPT(" ",LEN(A$2))),(ROW(Z1:Z99)-1)*LEN(A$2)+1,LEN(A$2)))))
Another way and hope it works
=SUMPRODUCT((LEN($A$2)-LEN(SUBSTITUTE($A$2,C2,"")))/LEN(C2))
@azumi,
Your formula count - say cat- but cats too, as cat.
dogs as dog.....
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks