+ Reply to Thread
Results 1 to 8 of 8

Extract Text and numbers from mixed cells

  1. #1
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Extract Text and numbers from mixed cells

    I have a column of cells with alphanumeric data. I would like to separate the text into one column and the numbers into another.
    The data is mostly text first followed by numbers. (eg ABCDE123)
    Occasionally there will be more letters or hyphens following the numbers. (eg ABCD1234-I)

    I am currently using the following formulas...
    To separate text: (I am happy with the results this produces)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To separate numbers: (This is my problem area)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    These work fine until the hyphen I (eg. -I) follows the data. Both the numbers and -I are displayed but I only want the numbers. I do not want to display the -I in either destination cell.

    Any suggestions on how to display numbers only whether they are at the end of the data or surrounded by text?
    Thanks

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Extract Text and numbers from mixed cells

    Try

    for numbers

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Extract Text and numbers from mixed cells

    try=LOOKUP(99^9,MID(A6,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A6&1/19)),{1,2,3,4,5,6,7,8,9,10})+0)
    to get number
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Extract Text and numbers from mixed cells

    To shukla.ankur281190 and nflsales
    Thanks, this does not add the [B]-I[B] which is great.
    However, if there are 0's in the numbers (eg, ABCD002) they are not included and the result is (eg). 2 not 002.
    Any suggestions on how to retain the 0s? If the numbers are of varying lengths I would like to keep the correct number of leading zeros.
    I know how to customize a cells formatting to retain a set number of digits, but not if they are of varying length.
    Last edited by Crawfy; 11-25-2017 at 03:43 AM.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Extract Text and numbers from mixed cells

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Extract Text and numbers from mixed cells

    From the Tab "Device List" I have used your formula in cells D6-10. This outputs numbers without leading zeros from the data entered in cells A6-10.
    In cells D12-16 I have change the formatting to text and manually typed the output i would expect to see from the data entered in cells A12-16
    I hope that makes sense.
    Attached Files Attached Files

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Extract Text and numbers from mixed cells

    try

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


    Copy down

  8. #8
    Forum Contributor
    Join Date
    05-28-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    119

    Re: Extract Text and numbers from mixed cells

    Thats great thank you.
    I'll have to study up on the trim and substitute functions.

+ 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] Extract value left of priod in mixed text and number
    By Vestlink in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-21-2016, 05:11 AM
  2. [SOLVED] Formula to extract text only from mixed string
    By FatKidonaTrampolin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-23-2015, 09:29 AM
  3. Extract Numbers in Mixed Cell (not string)
    By magic789 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-11-2015, 05:37 PM
  4. Replies: 2
    Last Post: 05-13-2015, 06:52 AM
  5. Extract Numbers from Mixed (Text + Numeric) Data
    By asimjavedcma in forum Excel General
    Replies: 1
    Last Post: 01-27-2015, 05:37 AM
  6. Extract text from cells with mixed characters
    By sa02000 in forum Excel General
    Replies: 4
    Last Post: 07-15-2014, 02:57 PM
  7. Summation of cells with mixed numbers & text
    By HTWingNut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-31-2007, 10:31 AM

Tags for this Thread

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