+ Reply to Thread
Results 1 to 11 of 11

To split numbers and characters

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-26-2012
    Location
    UAE
    MS-Off Ver
    Excel 2003
    Posts
    274

    To split numbers and characters

    Hi Friends,

    Could you please suggest two formula that will give me numbers only in one column and characters in another column

    20001 SYDNY-BRIDGE
    2002 SYDNY-CHINA
    203 SYDNY_WYN
    20700000 BROADWAY


    there are spaces before the characters

    thanks heaps

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,032

    Re: To split numbers and characters

    Look here:
    http://www.excelforum.com/excel-gene...ml#post3770803

    Just add TRIM function in front of SUBSTITUTE
    Never use Merged Cells in Excel

  3. #3
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: To split numbers and characters

    Hi,

    My solution will work if u have "Space" after ending of number .

    Punnam
    Attached Files Attached Files

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,032

    Re: To split numbers and characters

    Mine will work with or without space

  5. #5
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: To split numbers and characters

    @ zbor ,

    Can u plz explain what is happening in details for this
    =LOOKUP(99^99,--LEFT(A3,ROW($A$3:$A$6)))
    It will be more helpful to us
    Punnam

  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: To split numbers and characters

    =LOOKUP(99^99,--LEFT(A3,ROW($A$3:$A$6))) is not right
    =LOOKUP(99^99,--LEFT(A3,ROW($A$1:$A$100)))
    or
    maybe
    =LOOKUP(99^99,--LEFT(A3,ROW($1:$100)))
    the row bit needs to start at 1 and be at least as long as the text in a3
    use the evaluate formula option from the formula tab to see what is happening
    Last edited by martindwilson; 07-22-2014 at 03:31 AM.
    "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 Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: To split numbers and characters

    @ martindwilson you are right the formula shows me error i have change the range, i have done it to understand the logic .

    Please correct me if am wrong
    The lookup function is searching for a number in a range & when it is not in the array showing the last possible value in array

    Punnam

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

    Re: To split numbers and characters

    yep thats correct

  9. #9
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Office 365
    Posts
    1,899

    Re: To split numbers and characters

    Thanks for clarification

    Punnam

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

    Re: To split numbers and characters

    LOOKUP function return last value that is not a error and lower than lookup value.
    Since lookup value is very huge number (99^99 = 3,6973E+197) probably all numbers you use are lower than this (if not biggest number in excel is 9.99999999999999E+307 so it would be best to use that number but I'm lazy typing).

    For example, from range

    1
    1
    #N/A
    3
    2
    #N/A
    formula
    Formula: copy to clipboard
    =LOOKUP(100,B5:B10)
    will return 2 (latest number in range).

    LEFT function take strings from LEFT.
    ROW function evaluate array ROW(A1:A100) into 1,2,3,4....,98,99,100 and it will take 1st, 2nd,3rd..., 99th, 100th value from the left.
    Note: That's why it always start from 1st row, no matter where is data actually so you need to lock range if you moving formula around ROW($A$1:$A$100)

    From string 45453Punnam it will evaluate this:
    4
    45
    454
    4545
    45453
    45453P
    45453Pu
    45453Pun
    45453Punn
    45453Punna
    45453Punnam
    -- will convert this text into number so you will get:

    4
    45
    454
    4545
    45453
    #VALUE!
    #VALUE!
    #VALUE!
    #VALUE!
    #VALUE!
    #VALUE!
    Since last number is 45453 that's your desired result.

    Not that from 4545A3432432423423421534534Punnam
    It will return 4545 and if this is not your expected result then you need to change approach
    Last edited by zbor; 07-22-2014 at 03:53 AM.

  11. #11
    Forum Contributor
    Join Date
    06-26-2012
    Location
    UAE
    MS-Off Ver
    Excel 2003
    Posts
    274

    Re: To split numbers and characters

    Thank you very much ZBor, punnam and martin.

+ 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] [Solved]How to split up a group of characters
    By thollander in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-27-2014, 02:37 PM
  2. How to split a word to separate characters in excel?
    By Vikshal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-28-2013, 09:52 AM
  3. [SOLVED] split the characters separated by colon
    By bujji1305 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2012, 01:47 AM
  4. Replies: 1
    Last Post: 08-17-2011, 05:59 AM
  5. Split numbers and split words
    By Oddemann in forum Excel General
    Replies: 38
    Last Post: 05-10-2009, 02:57 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