Assuming sentence is in A1, try:
=COUNT(1/FREQUENCY(IF(TRIM(MID(SUBSTITUTE(" "&A1," ",REPT(" ",100)),ROW($A$1:$A$100)*100,100))<>"",MATCH(TRIM(MID(SUBSTITUTE(" "&A1," ",REPT(" ",100)),ROW($A$1:$A$100)*100,100)),TRIM(MID(SUBSTITUTE(" "&A1," ",REPT(" ",100)),ROW($A$1:$A$100)*100,100)),0)),ROW($A$1:$A$100)))
confirmed with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear around the formula.
This formula allows for up to 100 words in the cell...
Only replace the red A1's to reference another cell...
If you have more than 100 words adjust the occurrences $A$100 to suit.
Bookmarks