+ Reply to Thread
Results 1 to 14 of 14

Removing two letters from a string of letters and numbers

  1. #1
    Registered User
    Join Date
    07-29-2014
    Location
    Atlanta, GA
    MS-Off Ver
    2010
    Posts
    2

    Removing two letters from a string of letters and numbers

    i have a list of 2000 fields which have the same format IE "AB10014"

    I need to remove the "AB" from every field and leave the #.

    Besides putting a space and running text to columns I'm not sure how. Thanks for your help.

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

    Re: Removing two letters from a string of letters and numbers

    Hi FobesA,

    1. Select your range of cells, e.g. A1:A2000.
    2. Click 'Find & Select' then 'Replace...' (or just press CTRL+H)
    3. In 'Find what:' type: AB
    4. Leave 'Replace with:' blank
    5. Click 'Replace All'

    That should do it. (Note: If any of the numbers start with zero, e.g. AB00123, it will drop those zeros leaving just 123.)

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Removing two letters from a string of letters and numbers

    Or use formula

    =SUBSTITUTE(A1,"AB","")

    A
    B
    1
    AB10014 10014
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Removing two letters from a string of letters and numbers

    =RIGHT(A1;LEN(A1)-2)
    Here another one
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Removing two letters from a string of letters and numbers

    Here yet another way.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Removing two letters from a string of letters and numbers

    mid doesn't worry about length of string
    =MID(A1,3,100) would do
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Removing two letters from a string of letters and numbers

    Or even:

    =MID(A1,3,255)

    Note that the string formulae in posts 3 to 6 (and this one) will return a text value that looks like a number. If you want the answer as a proper number then you can add zero to the formula (+0) or multiply by 1 (*1) or use a double minus in front of the formula (--). Leading zeros will be removed, as Paul pointed out.

    Hope this helps.

    Pete

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Removing two letters from a string of letters and numbers

    And this

    =REPLACE(A1,1,2,"")

  9. #9
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Removing two letters from a string of letters and numbers

    If you want the output to be a number:

    =1*RIGHT(A1,LEN(A1)-2)

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Removing two letters from a string of letters and numbers

    @ cbatrody
    that would be just as pointed out in post #7 then!

  11. #11
    Registered User
    Join Date
    09-01-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Removing two letters from a string of letters and numbers

    Remove characters from text
    Let me clear it with an example
    Let's say you want to split a text column of phone numbers formatted as 999-999-9999 into three columns of numbers: area code, prefix, and number. There are several ways to remove characters from text.

    What do you want to do?
    Remove a specified number of characters from the right or left side of text
    Remove a text string from a worksheet by using the Replace command
    Remove a specified number of characters from the right or left side of text
    To do this task, use the LEN, LEFT, and RIGHT functions.

    Example
    The example may be easier to understand if you copy it to a blank worksheet.

    ShowHow to copy an example


    1
    2
    3
    A
    Data
    Vitamin A
    Vitamin B1
    Formula Description (Result)
    =LEFT(A2, LEN(A2)-2) Removes last two characters from contents of A2 (Vitamin)
    =RIGHT(A3, LEN(A3)-8) Removes first 8 characters from A3 (B1)
    Function details
    LEN, LENB

    LEFT, LEFTB

    RIGHT, RIGHTB

    Top of Page TOP OF PAGE

    Remove a text string from a worksheet by using the Replace command
    Select the range of cells that you want to search.
    If you want to search the entire worksheet, click any cell in the worksheet.

    On the Home tab, in the Editing group, click Find & Replace, and then click Replace.
    In the Find what box, enter the text or numbers that you want to search for or choose a recent search from the Find what drop-down box.
    NOTE You can use wildcard characters in your search criteria.

    If you want to specify a format for your search, click Format and make your selections in the Find Format dialog box.
    Click Options to further define your search. For example, you can search for all of the cells that contain the same kind of data, such as formulas.
    In the Within box, you can select Home or Workbook to search a worksheet or an entire workbook.

    In the Replace with box, enter the replacement characters and specific formats if necessary.
    If you want to delete the characters in the Find what box, leave the Replace with box blank.

    Click Find Next.
    To replace the highlighted occurrence or all occurrences of the found characters, click Replace or Replace All.
    NOTE To cancel a search in progress, press ESC.

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Removing two letters from a string of letters and numbers

    @amankmr17

    Since that is, verbatim, the content of the following link, wouldn't it have been better to simply post the link instead?

    http://office.microsoft.com/en-gb/ex...010062742.aspx

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  13. #13
    Registered User
    Join Date
    07-29-2014
    Location
    Atlanta, GA
    MS-Off Ver
    2010
    Posts
    2

    Re: Removing two letters from a string of letters and numbers

    you all are the best! Thanks you saved me a big headache here...just starting back up using excel more commonly. I tried several to check em out. Appreciate it.

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Removing two letters from a string of letters and numbers

    Glad to be able to help.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Removing letters from text string
    By cmb80 in forum Excel General
    Replies: 10
    Last Post: 07-14-2014, 09:08 AM
  2. [SOLVED] Removing letters from text & letters combination
    By benoj2005 in forum Excel General
    Replies: 5
    Last Post: 02-26-2014, 11:20 AM
  3. Replies: 10
    Last Post: 08-26-2013, 04:25 PM
  4. Removing leading numbers, letters, full stop, and space
    By Hambone70 in forum Excel General
    Replies: 2
    Last Post: 02-16-2011, 01:09 PM
  5. Removing all text except numbers and letters
    By stoopkid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-04-2007, 11:25 PM

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