+ Reply to Thread
Results 1 to 7 of 7

Extract one text from csv file

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    Brampton, ONTARIO
    MS-Off Ver
    Excel 365
    Posts
    78

    Extract one text from csv file

    Hello,

    I need a help to create a formula to extract one text starting with same first four characters. Please see attached file.
    For example column A is copy of CSV file and need to extract reference number starting with "ABCD"with two alphabets and digits assigned with it. The reference number does not align when use "text to columns"

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Extract one text from csv file

    Hi,

    first attempt: in B7


    =TRIM(MID(A7,SEARCH("ABCD",A7),15))

    to be copied down.

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    03-18-2014
    Location
    Brampton, ONTARIO
    MS-Off Ver
    Excel 365
    Posts
    78

    Re: Extract one text from csv file

    Thanks! related to same, is it possible to extract further digit numbers only from reference number which can vary from 1 characters to 10 characters. see expected answers in attached file in column C.

    Thanks for your help!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Extract one text from csv file

    Hi

    a very inefficient approach to get the max number (1 to 1000000) could be

    =AGGREGATE(14,6,ROW(1:1000000)/ISNUMBER(FIND(ROW(1:1000000),MID(A7,SEARCH("ABC",A7),15))),1)


    maybe a more modest contribution to global warming from

    =TRIM(MID(MID(A7,SEARCH("ABC",A7),15),AGGREGATE(15,6,FIND(ROW($1:$10)-1,MID(A7,SEARCH("ABC",A7),15)),1),10))+0
    Last edited by canapone; 03-09-2020 at 10:21 AM.

  5. #5
    Registered User
    Join Date
    03-18-2014
    Location
    Brampton, ONTARIO
    MS-Off Ver
    Excel 365
    Posts
    78

    Re: Extract one text from csv file

    Hi,

    Thanks for reply. Would it be easy to do a formula to get numbers from values in column B13 so that in Column C13 only numbers and this way don't have to go to A7. (I need both columns).
    Example : column B13 ABCDPP119948 and Column C13 should be 119948

    Thanks!

  6. #6
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Extract one text from csv file

    Hi again

    in B7 to be copied down along the strings

    =MID(A7,SEARCH("ABCD",A7),15)

    in C7

    =--MID(B7,AGGREGATE(15,6,FIND(ROW($1:$10)-1,B7),1),15)

    or

    =MID(B7,AGGREGATE(15,6,FIND(ROW($1:$10)-1,B7),1),15)+0


    Regards
    Last edited by canapone; 03-09-2020 at 10:28 AM.

  7. #7
    Registered User
    Join Date
    03-18-2014
    Location
    Brampton, ONTARIO
    MS-Off Ver
    Excel 365
    Posts
    78

    Re: Extract one text from csv file

    Thank you very much!

+ 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. extract text from variable length strings in text file
    By Wiigit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2019, 01:33 PM
  2. Extract text between two words in a text file and paste to Excel
    By rasull13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2018, 03:38 PM
  3. Extract specific columns from text file and export to another text file
    By KingTamo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-02-2017, 01:00 AM
  4. Extract specific text from Text file
    By pvsvprasad in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 08-22-2016, 04:34 AM
  5. Extract text to file name
    By Jhedge in forum Excel General
    Replies: 5
    Last Post: 11-12-2014, 04:51 PM
  6. How to extract Information from an Excel File and entering those data in a text file?
    By bikash.nitk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2012, 12:13 PM
  7. Extract a part of Text file
    By parasbshah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2011, 02:55 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