+ Reply to Thread
Results 1 to 37 of 37

LEN formula excludes line feed?

Hybrid View

Pavan Renjal LEN formula excludes line... 01-06-2013, 02:18 PM
Norie Re: LEN formula excludes line... 01-06-2013, 02:24 PM
TMS Re: LEN formula excludes line... 01-06-2013, 02:31 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 03:01 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 02:46 PM
Norie Re: LEN formula excludes line... 01-06-2013, 02:49 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 02:56 PM
Norie Re: LEN formula excludes line... 01-06-2013, 02:57 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 03:13 PM
Norie Re: LEN formula excludes line... 01-06-2013, 03:07 PM
Norie Re: LEN formula excludes line... 01-06-2013, 03:32 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 03:42 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 03:46 PM
Norie Re: LEN formula excludes line... 01-06-2013, 03:46 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 03:51 PM
shg Re: LEN formula excludes line... 01-06-2013, 03:53 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 03:57 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 04:00 PM
shg Re: LEN formula excludes line... 01-06-2013, 04:06 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 04:11 PM
TMS Re: LEN formula excludes line... 01-06-2013, 04:16 PM
TMS Re: LEN formula excludes line... 01-06-2013, 04:27 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 04:41 PM
TMS Re: LEN formula excludes line... 01-06-2013, 04:48 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 05:13 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 05:15 PM
TMS Re: LEN formula excludes line... 01-06-2013, 05:22 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 05:37 PM
TMS Re: LEN formula excludes line... 01-06-2013, 06:52 PM
Pavan Renjal Re: LEN formula excludes line... 01-06-2013, 07:00 PM
dredwolf Re: LEN formula excludes line... 01-06-2013, 08:27 PM
Pavan Renjal Re: LEN formula excludes line... 01-07-2013, 03:26 AM
Pavan Renjal Re: LEN formula excludes line... 01-07-2013, 03:28 AM
Norie Re: LEN formula excludes line... 01-07-2013, 03:35 AM
Pavan Renjal Re: LEN formula excludes line... 01-07-2013, 08:00 AM
vlady Re: LEN formula excludes line... 01-07-2013, 03:46 AM
Pavan Renjal Re: LEN formula excludes line... 01-07-2013, 08:04 AM
  1. #1
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Thumbs up Re: LEN formula excludes line feed?

    Awesome stuff!!! Just what i needed! Works like a charm! Thanks a ton bro! Phew!

    Quote Originally Posted by dredwolf View Post
    if you dont' mind a VBA UDF you can use this to get the count of char(10) :
    Function CountOccurOf(SrchStr As String, StrVal As String, Optional StrtPos, Optional CaseSensitive) As Long
        Dim LCount, Count As Long
        If IsMissing(StrtPos) Then StrtPos = 1
        If IsMissing(CaseSensitive) Then CaseSensitive = True
        CountOccurOf = 0
        If StrtPos > Len(StrVal) Then Exit Function
        If Len(SrchStr) = 0 Or Len(StrVal) = 0 Then Exit Function
        Count = 0
        For LCount = 0 + StrtPos To Len(StrVal)
            If CaseSensitive Then
                If Mid(StrVal, LCount, Len(SrchStr)) = SrchStr Then Count = Count + 1
            Else
                If UCase(Mid(StrVal, LCount, Len(SrchStr))) = UCase(SrchStr) Then Count = Count + 1
            End If
        Next LCount
        CountOccurOf = Count
    End Function
    To insert into your workbook, open VBA editor (Alt+F11),
    Insert -> Module
    Copy the Above code, then Paste into the new module,
    Save, Then Close Editor;

    your Formula would Look like this :
    A1: =LEN(A2)+CountOccurOf(CHAR(10),A2)

    Hope this helps

  2. #2
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: LEN formula excludes line feed?

    Thanks a ton TMShucks and dredwolf! Thanks for everything! Brilliant stuff! Cheers!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1