+ Reply to Thread
Results 1 to 3 of 3

Breaking up a long string

  1. #1
    Registered User
    Join Date
    01-05-2009
    Location
    New Delhi
    MS-Off Ver
    Excel 2007
    Posts
    41

    Breaking up a long string

    Hi,
    I have a table containing complete address in column A as per attachment. I would like to break it into two fields (Address1 and Address2), whereby the 1st half of the Address should come into the column Address1 and be "limited" to approx 25 letters. The rest of the address can go into Address2.

    However, (obviously) the 25 letter limit should not break-up a word. Also, I cannot use a fixed width de-limiter since the addresses are all of variable length.

    Help would be deeply appreciated. Thankx !
    Attached Files Attached Files
    Last edited by bitswit; 11-23-2011 at 05:20 AM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Breaking up a long string

    Hi Bitswit,

    Perhaps try these formulas:

    In B2: =IF(MID(A2,25,1)=" ",LEFT(A2,25),LEFT(A2,25+FIND(" ",A2,25)-25))

    In C2: =RIGHT(A2,LEN(A2)-LEN(B2))

    Hope that helps!

  3. #3
    Registered User
    Join Date
    01-05-2009
    Location
    New Delhi
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Breaking up a long string

    Thanks Paul,
    Serves my purpose admirably !!

+ 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