+ Reply to Thread
Results 1 to 5 of 5

creating a formula to copy text from one column to another

  1. #1
    Registered User
    Join Date
    07-23-2010
    Location
    calgary,alberta
    MS-Off Ver
    Excel 2007
    Posts
    4

    creating a formula to copy text from one column to another

    Hello.
    I have used this formula that i had found online:
    =RIGHT(B115,LEN(B115)-SEARCH("_",B115,SEARCH("_",B115,SEARCH("_",B115,1)+1)+1))

    Now i need this formula to do the following:

    Scenario A:

    Column B: has the following value: APP_AEPEA_705-01-00_4.7.4
    Column C: i need it to have the value of: 4.7.4

    As well: if column B has the value: APP_80105-00-01_2.1.1 ...... so just 2 underscores within it, i need column C to present the value 2.1.1

    So basically after whichever the last "_" is within the string of alphanumeric values anything following after the last "_" i need it to be transported over to column C no matter whether it is numeric or alphabetical.

    The formula i have provided above, has helped me with alphanumeric strings that contained 3 "_" units but not with 2 "_" or "abcdefg" values.

    If someone know's how to create this formula to work on all that would be greatly appreciated.

    Thanks a bunch.

    Dan
    Last edited by giuredan; 07-23-2010 at 12:01 PM. Reason: poor title

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: formula trouble

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: creating a formula to copy text from one column to another

    Right, are you ready for this?

    Assuming your value is in A2 the simple little formula you need is ...

    =IF(ISERR(FIND("_",A2,FIND("_",A2,FIND("_",A2)+1)+1)),RIGHT(A2,LEN(A2)-FIND("_",A2,FIND("_",A2)+1)),RIGHT(A2,LEN(A2)-FIND("_",A2,FIND("_",A2,FIND("_",A2)+1)+1)))

    Lovely, eh?
    Last edited by Andrew-R; 07-23-2010 at 12:38 PM.

  4. #4
    Registered User
    Join Date
    07-23-2010
    Location
    calgary,alberta
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: creating a formula to copy text from one column to another

    wow LOL
    what a beauty she is.
    now if i wanted to take that formula and reverse it, in the sense of :

    AENV_APP_00248651-00-00_BOAT <----- this is the string

    and i want all the text to be copied from before the word BOAT (excluding the last underscore) and THEN combine then text that i have in column C which i used your formula for, obviously with the small change of having all the A's changed to C's for column search.....how the heck would i do that?

    =IF(ISERR(FIND("_",C2,FIND("_",C2,FIND("_",C2)+1)+1)),RIGHT(C2,LEN(C2)-FIND("_",C2,FIND("_",C2)+1)),RIGHT(C2,LEN(C2)-FIND("_",C2,FIND("_",C2,FIND("_",C2)+1)+1)))


    that's what i used :D with your help

  5. #5
    Registered User
    Join Date
    07-23-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: creating a formula to copy text from one column to another

    I would use :

    =RIGHT(B1,LEN(B1)-IF(ISERR(FIND("_",B1,FIND("_",B1,FIND("_",B1)+1)+1)),FIND("_",B1,FIND("_",B1)+1),FIND("_",B1,FIND("_",B1,FIND("_",B1)+1)

    to get the last bit &

    =LEFT(B1,IF(ISERR(FIND("_",B1,FIND("_",B1,FIND("_",B1)+1)+1)),FIND("_",B1,FIND("_",B1)+1),FIND("_",B1,FIND("_",B1,FIND("_",B1)+1)+1))-1)

    to get the first bit

+ 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