+ Reply to Thread
Results 1 to 6 of 6

what is the farmula to saprate nums and char in a cell

  1. #1
    Registered User
    Join Date
    05-04-2014
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    7

    what is the farmula to saprate nums and char in a cell

    problem is that

    fsh45fdh8fd
    rfas85412
    r321s845

    i want the following results
    fshfdhfd 458

    rfas 85412


    rs 321845

    what is the farmula to saprate nums and char in a cell

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: what is the farmula to saprate nums and char in a cell

    Hi, welcome to the forum :0

    See this...
    Attached Files Attached Files
    Regards,
    Rudi

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,133

    Re: what is the farmula to saprate nums and char in a cell

    Rudi's formula works, except that if there's a zero in the sequnce, it appears in the text column and the numbers column. Add another nest of substitutes and it works perfectly.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Is there a more elegant way of doing this, though??

  4. #4
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: what is the farmula to saprate nums and char in a cell

    Hi Glen,

    TX for that addition.
    As for a more elegant way....I'd say by using VBA and creating a user defined function.

  5. #5
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: what is the farmula to saprate nums and char in a cell

    a couple of VBA methods...
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: what is the farmula to saprate nums and char in a cell

    Here are a couple of formulas (with limitations).

    Data Range
    A
    B
    C
    2
    fsh45fdh8fd
    fshfdhfd
    458
    3
    rfas85412
    rfas
    85412
    4
    r321s845
    rs
    321845


    The length of the string must be <=300 characters.

    The total number of digits in the string must be <=14 digits.

    Note that the extracted numbers are a TEXT string even though they look like numbers. This is necessary to keep any leading zeros.

    This will not work in Excel versions 2003 and earlier.

    Create this named formula.
    Goto the Formulas tab>Define name
    Name: Array
    Refers to: =ROW(INDIRECT("A1:A300"))
    OK out

    Enter this formula in B2:

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,0,""),1,""),2,""),3,""),4,""),5,""),6,""),7,""),8,""),9,"")

    Enter this array formula** in C2:

    =MID(SUMPRODUCT(--MID("01"&A2,SMALL((Array-1)*ISNUMBER(-MID("01"&A2,Array,1)),Array)+1,1),10^(300-Array)),2,300)

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Select B2:C2 and copy down as needed.

    These formula may work but I think something like this is best done using VBA functions.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] Need Looking up Farmula or Function
    By Sher Muhammad in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-30-2013, 10:20 AM
  2. Changing a single Char in a string to another ASCII char
    By goofy78270 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2007, 09:45 AM
  3. [SOLVED] how to create farmula in excle programming
    By Ajaynagpur in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2006, 08:35 AM
  4. Have column of nums, need qty of each?
    By samckitt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-02-2006, 01:20 PM
  5. Replies: 6
    Last Post: 03-10-2006, 01:15 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