+ Reply to Thread
Results 1 to 11 of 11

Formula to shorten an alphanumeric line of text

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2007
    Posts
    27

    Formula to shorten an alphanumeric line of text

    I'm using the formula '=LEFT(A2,4)+0 to shorten a numbered line of text.Is there a way to adopt that formula to do the same thing to an alphanumeric line of text (i.e. 80A0267AA1 to read 80A0267) or even better substitute a "-" in place of the "A" (i.e. 80A0267AA1 to read 80-0267)? I know this is really picky, but I figure it's worth a shot. Thanks
    Last edited by krie2509; 01-26-2010 at 10:03 AM. Reason: 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: Shorten an alphanumeric line of text

    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.

    I've removed surplus wording this time
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: I'm trying to shorten an alphanumeric line of text

    My title is almost the same format as several other posts in this forum. Should I post it as a question?

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

    Re: I'm trying to shorten an alphanumeric line of text

    Your title contains unnecessary wording - "I'm trying to",this is unnecessary in any search terms & makes the Forum Search less efficient

  5. #5
    Registered User
    Join Date
    01-25-2010
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Formula to shorten an alphanumeric line of text

    I appreciate that you are trying to manage and organize the forum efficiently, but I'm spending more time changing my title than receiving any help. My original title was "shorten an alphanumeric line of text" which is nearly identical in format as hundreds of other posts on this forum and I was told this is in violation with RULE 1, but with no explanation how it is in violation. My solution would be to answer the question in the post and then point out how the title should be changed. This would kill two birds with one stone, I would receive the help I'm looking for and I would learn what format is needed for the title. This is just a suggestion, there is a wealth of knowledge on this site and I would like to be able to use it to improve my understanding.

  6. #6
    Registered User
    Join Date
    01-25-2010
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Formula to shorten an alphanumeric line of text

    BUMP I hope I haven't been blackballed

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Formula to shorten an alphanumeric line of text

    Do you want replace the first "A" with a dash then eliminate all letters from the value?
    Do you want replace the first letter with a dash then eliminate all letters from the value?

    Can you tell us a bit more about your starting data?
    Will it always be in this general format:
    digit digit letter digit digit digit digit letter letter digit
    Example:

    Please Login or Register  to view this content.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Formula to shorten an alphanumeric line of text

    Something like this:

    =SUBSTITUTE(LEFT(F2,7),"A","-")

    But everything depeding on your input

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Formula to shorten an alphanumeric line of text

    I've been trying something but didn't make it...

    However.. This is where I stuck... How to find first character in a string (A in above case)...

    Please Login or Register  to view this content.

    Now is the question.. How to take min value from array with #VALUE!
    3 is my first non error character...

    And it's 3:46 AM... and I think I have enough for today
    Last edited by zbor; 01-25-2010 at 10:49 PM.

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to shorten an alphanumeric line of text

    Quote Originally Posted by zbor
    How to find first character in a string (A in above case)...
    zbor, I think Ron will come up with an elegant solution once we know the full requirements of the OP but in general, to answer your question:

    Generally speaking:

    Please Login or Register  to view this content.
    or using your INDEX construct

    Please Login or Register  to view this content.
    the same is seen with numerics:

    Please Login or Register  to view this content.
    but as I say I'm sure Ron has some nice tricks up his sleeve...

  11. #11
    Registered User
    Join Date
    01-25-2010
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Formula to shorten an alphanumeric line of text

    Quote Originally Posted by zbor View Post
    Something like this:

    =SUBSTITUTE(LEFT(F2,7),"A","-")

    But everything depeding on your input

    This worked perfectly. Thank you so much

+ 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