+ Reply to Thread
Results 1 to 6 of 6

pick certain characters

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-22-2008
    Location
    canada
    Posts
    123

    pick certain characters

    Please help me on the following scenario:

    I have column A which always contains character "-". I would like to be able to just get the characters before the "-" and be able to copy that on col B.

    example:

    A1= "1234f - bla bla bla2"
    A2= "H3B - bla bla bla3"

    I would like to get only 1234f an copy it to B1 and so on. Please help. Thank you.

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256

    Re: pick certain characters

    Try using the LEFT and FIND formulas as such

    =LEFT(A1,FIND("-",A1)-1)

    Hope that helps...
    John
    "I don't know what I don't know"

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: pick certain characters

    =LEFT(A1,SEARCH("-",A1)-1)
    Assuming there's not a space in front of the -. Otherwise, you can preceed it with TRIM or do use -2 instead of -1. Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    07-22-2008
    Location
    canada
    Posts
    123

    Re: pick certain characters

    Thank for your respond. Both formula from kraljb and ChemistB worked perfectly. Good job guys. Thank you very much.

    I just need one more help on understanding the -1 at the last statement.What does that mean?


    Thanx.

  5. #5
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256

    Re: pick certain characters

    The FIND function tells us how many characters in the "-" is located.

    The LEFT function grabs a number of characters starting with the left most.

    Since we only want things before the "-" we want the location of it -1.

    Hope that helps explain it...
    John

  6. #6
    Registered User
    Join Date
    07-20-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Pick certain characters within the same cell

    Hi

    Please help me out.

    Would want to pick only few characters in the same cell
    For eg
    A1 = [dsfsdjf]
    [asfdjf]

    i want only those characters in between special characters[] to appear in B1
    i.e. dsfsdjf
    asfdjf

    Pls assist. Thank You

+ 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