+ Reply to Thread
Results 1 to 8 of 8

Number Length

  1. #1
    Registered User
    Join Date
    03-23-2007
    Posts
    91

    Number Length

    Hi

    Is there an easy way of determining the length of a column
    like
    A
    4
    4
    4
    66
    77.44
    88,000

    I know if I use the Len function I'll get the result. However if the data has commas or periods it won't read them.
    I would like to know if there is a function that would let me know that there are 5 characters in the cell that has 77.44.

    Thanks

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Returning the correct len for me

    What result are you getting

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    03-23-2007
    Posts
    91
    Did you get 5?
    It only counts the numbers for me not everything.
    for example 88,000 only returns 5
    88.000 returns 6. that's working fine

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    It works unless its a even number

    e.g

    66.00

    VBA Noob

  5. #5
    Registered User
    Join Date
    03-23-2007
    Posts
    91
    that's fine. I really dont need that one.
    But I was wondering if there is a way to fix
    3,500
    With the comma it doesnt work
    unless its something like 44,00

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try this

    =IF(CELL("format", A1)="F2",LEN(A1)+3,LEN(A1))

    VBA Noob

  7. #7
    Registered User
    Join Date
    03-23-2007
    Posts
    91
    it returns a 4. for 3,400

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =IF(CELL("format",A1)="F2",LEN(A1)+3,IF(CELL("format",A1)=",0",LEN(A1)+1,IF(OR(CELL("format",A1)=",0",CELL("format",A1)="F2"),"",LEN(A1))))

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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