I think he deserves an "A".
'---
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(XLCompanion counts and lists words)
"Rick Rothstein" <(E-Mail Removed)>
wrote in message
news:ih71s1$gpl$(E-Mail Removed)...
> Pete, I have a sneaking suspicion that you just did Kevin's homework assignment for him
> (I could be wrong about this though).
> Rick Rothstein (MVP - Excel)
> "Pete_UK" wrote in message
> news:8d99e70e-ce38-47ff-9181-(E-Mail Removed)...
>
> 1. The trick here is to count the number of spaces and add one. This
> formula will do so, say in C2:
>
> =LEN(A2) - LEN(SUBSTITUTE(A2," ","")) + 1
>
> assuming your string is in A2. You might like to put Num_words in C1
> as a heading.
>
> 2. LEN returns the number of characters, so you could put this formula
> in, say, D2:
>
> =IF(C2=1,LEN(A2),"")
>
> which only returns a value for single-word entries in column A. Put
> Num_letters as the heading in D1.
>
> 3. A formula cannot delete a row. You can use a formula to mark a row
> for deletion, and then delete all marked rows later in one operation
> using a filter (or you could use a macro to do it for you). You could
> put this formula in E2:
>
> =IF(C2>1,"Delete","OK")
>
> 4. Put this formula in F2:
>
> =IF(AND(D2<>"",D2<5),"Delete","ok")
>
> I've assumed 5 letters for your "x".
>
> 5. Put this formula in G2:
>
> =IF(AND(C2=1,A2="it"),"Delete","ok")
>
> All these formulae can be copied down for as many phrases as you have.
> Then you can apply autofilter (Data | Filter | Autofilter), and then
> you can use the filter drop-down in column E and select Delete from
> the list. Then highlight all the visible rows and click on Edit |
> Delete and then select All in that filter. Do the same for columns F
> and for G.
>
> Hope this helps. Pete