+ Reply to Thread
Results 1 to 5 of 5

Copy frist six characters of a string only if first character is non numeric in cell

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    East london
    MS-Off Ver
    Excel 2010
    Posts
    17

    Copy frist six characters of a string only if first character is non numeric in cell

    hi guys,

    please help me? i've tried left and mid and trim but can't get to do the following;

    cell B1 "abc123 1 2 3 adc"
    Cell B2 "123adc123"
    Cell B3 "1 b c 2 d e 123abc"

    i need a fromula that will copy first 6 characters in cells in column b to new column only if as in B1. ie. first character is non numeric and first 6 characters are not seperated.

    Please help me?

    thx
    DeeBee

  2. #2
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2013
    Posts
    118

    Re: Copy frist six characters of a string only if first character is non numeric in cell

    Hi DeeBee,

    I almost have what you're looking for:
    Please Login or Register  to view this content.
    But for some reason, the ISNUMBER() returns false regardless if the first character is a number....I'll look into it a little more.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Copy frist six characters of a string only if first character is non numeric in cell

    Try this ...
    Please Login or Register  to view this content.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Copy frist six characters of a string only if first character is non numeric in cell

    @ weeble33

    LEFT(B1,1) will always return a string. To return a number you need to multiply by 1, or add 0

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    LEFT(),MID(), and RIGHT() are all string handling functions, all return strings, never numbers.
    Last edited by Marcol; 06-21-2012 at 11:32 AM.

  5. #5
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2013
    Posts
    118

    Re: Copy frist six characters of a string only if first character is non numeric in cell

    Ah, yea. I did a Cell() function and determined it was returning a string, just didn't know how to coerce a number.

    Well, for what it's worth I believe this works to:
    Please Login or Register  to view this content.

+ 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