Hi
Hopefully an easy one, I am trying to count across a row the number of times a cell contains more than 3 charactors.
I have tried count if with a Len function and a sumproduct but keep getting a #value error returned.
Thank you
Jeff
Hi
Hopefully an easy one, I am trying to count across a row the number of times a cell contains more than 3 charactors.
I have tried count if with a Len function and a sumproduct but keep getting a #value error returned.
Thank you
Jeff
Here is a VBA solution for you assuming your data starts in cell A1
Option Explicit
Sub Count3()
Dim lr As Long
Dim lc As Long
Dim x As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Dim i As Long, j As Long
For i = 1 To lr
x = 0
For j = 1 To lc
If Len(Cells(i, j)) > 3 Then
x = x + 1
End If
Next j
Cells(i, lc + 1) = x
Next i
MsgBox "completed"
End Sub
Display More
thank you
I was missing the N part!
Works perfectly
Glad you could fix your problem ...
Thanks for your Thanks ... AND for the Like
Don’t have an account yet? Register yourself now and be a part of our community!