ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   hi, how can I do wordcount in Excel? (https://www.excelbanter.com/charts-charting-excel/220049-hi-how-can-i-do-wordcount-excel.html)

Marketa

hi, how can I do wordcount in Excel?
 
hi,doers anyone know how to do wordcount in Excel? I appreciate your help,
Manz thanks, Marketa

Dave Curtis[_2_]

hi, how can I do wordcount in Excel?
 
Hi,

Try this code from Chip Pearson's page.

Sub CountWords()
Dim WordCount As Long
Dim Rng As Range
Dim S As String
Dim N As Long
For Each Rng In ActiveSheet.UsedRange.Cells
S = Application.WorksheetFunction.Trim(Rng.Text)
N = 0
If S < vbNullString Then
N = Len(S) - Len(Replace(S, " ", "")) + 1
End If
WordCount = WordCount + N
Next Rng
MsgBox "Words In ActiveSheet Sheet: " & Format(WordCount,"#,##0")
End Sub


Dave

"Marketa" wrote:

hi,doers anyone know how to do wordcount in Excel? I appreciate your help,
Manz thanks, Marketa


Dave Curtis[_2_]

hi, how can I do wordcount in Excel?
 
Or you can use the following formula to count the words in a range:

=SUM(LEN(A1:F10))-SUM(LEN(SUBSTITUTE(A1:F10," ","")))+COUNTA(A1:F10)

entered as an array formula with Control-Shift-Enter.

Dave


"Marketa" wrote:

hi,doers anyone know how to do wordcount in Excel? I appreciate your help,
Manz thanks, Marketa



All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com