+ Reply to Thread
Results 1 to 10 of 10

Excel to get certain text from data

  1. #1
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Excel to get certain text from data

    Hello All,

    Sorry to bother you guys. Kinda need some help on a formula.
    I have an attached file where I have loads of data in column J. I need it to only locate a number starting with C00* and display it in column L. I tried using array formula and Find formula but it still does not get me the value I need.

    I have put the Example output in column L as how I need it. Is this possible to be done?
    If there is multiple C00* then it should also display that and if there is none found then show as "Not Found".

    Hope someone is able to help. :-)

    Kind Regards,
    Mark.
    Attached Files Attached Files

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel to get certain text from data

    Hi,

    Is VBA allowed for the solution? It will make returning multiple matches much simpler I believe. Also, are all the codes the same length as they appear to be in your example data?

  3. #3
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Excel to get certain text from data

    Quote Originally Posted by xlnitwit View Post
    Hi,

    Is VBA allowed for the solution? It will make returning multiple matches much simpler I believe. Also, are all the codes the same length as they appear to be in your example data?
    Hi xlnitwit,

    Would be great if there is such a macro which can do this. Would make my life easier but I'm not sure how to do so. :-(

    Kind Regards,
    Mark.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel to get certain text from data

    It looks like the same code can appear several times in one cell? In such a case, do you want the function to return it multiple times or should it only return a list of unique values?

    This code will return all matches regardless but would need amending to return unique values only:
    Please Login or Register  to view this content.
    You need to add the code to a normal module and then call it from a cell:
    =MatchNumbers(J2)
    for instance.
    Last edited by xlnitwit; 06-28-2016 at 07:25 AM.

  5. #5
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Excel to get certain text from data

    Quote Originally Posted by xlnitwit View Post
    It looks like the same code can appear several times in one cell? In such a case, do you want the function to return it multiple times or should it only return a list of unique values?
    Hi xlnitwit,

    Yes it should only capture the unique values in each cell. :-)

    Kind Regards,
    Mark.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel to get certain text from data

    All right then - here is the revised function code:
    Please Login or Register  to view this content.

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel to get certain text from data

    By the way, you didn't answer my earlier question but if all the codes are the same length, you could amend the pattern in the function code to use:
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Excel to get certain text from data

    Quote Originally Posted by xlnitwit View Post
    All right then - here is the revised function code:
    Please Login or Register  to view this content.

    Hi xlnitwit,

    Tried that and it returns a failed value #NAME?. Npt sure if im doing this correctly?

    Kind Regards,
    Mark.

  9. #9
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Excel to get certain text from data

    Quote Originally Posted by mark888 View Post
    Hi xlnitwit,

    Tried that and it returns a failed value #NAME?. Npt sure if im doing this correctly?

    Kind Regards,
    Mark.

    Hi xlnitwit,

    Yes I tried it again. I made a mistake. It works perfectly as a function. Many thanks sir for your help. :-)

    Kind Regards,
    MArk.

  10. #10
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Excel to get certain text from data

    You are most welcome.

+ 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. Data text to convert into excel
    By goya in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 01-25-2016, 08:32 AM
  2. [SOLVED] How to read text data from .dat files and fetch the data in to excel based on input..
    By mahendra.asapu in forum Excel Programming / VBA / Macros
    Replies: 62
    Last Post: 07-19-2015, 04:36 AM
  3. Mutliple data from Text to Excel
    By Johhnwilliam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2015, 07:00 AM
  4. Data from a text file into excel
    By vutienhp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-23-2014, 05:27 AM
  5. How to input data from a text to excel using Excel VBA?
    By Derry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2011, 09:28 PM
  6. [SOLVED] Numbers/Text data missing from excel to excel query?
    By RAMAERTE in forum Excel General
    Replies: 0
    Last Post: 05-08-2006, 12:10 PM
  7. [SOLVED] How to make text data export to excel in text format.
    By ~@%.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2006, 11:20 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