+ Reply to Thread
Results 1 to 15 of 15

Extract a specific line from a excel cell (containing multi line text)

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    130

    Extract a specific line from a excel cell (containing multi line text)

    Hi Everyone,
    Is there a way to extract only a specific line from excel cell(containing multi line text) where that specific line contains a specific word e.g "shipping"? I will really appreciate your help. Best Regards

  2. #2
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    How are the lines separated? Please post a sample sheet.

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    130

    Re: Extract a specific line from a excel cell (containing multi line text)

    Please check the attachment for explanation.
    Attached Files Attached Files

  4. #4
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    Is it always the last line (a single line sample may not be representative!!!!)?

  5. #5
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    130

    Re: Extract a specific line from a excel cell (containing multi line text)

    Actually, each cell contains a data with multiple lines. I will extract each line based on what they contain. So it is just a small example. I will extract multiple information from this cell by extracting lines one by one which contains specific word/string.

  6. #6
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    Can you provide a representative sample.

  7. #7
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    130

    Re: Extract a specific line from a excel cell (containing multi line text)

    Please check the attached representative sample.
    Attached Files Attached Files

  8. #8
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    One way:

    =IFERROR(TRIM(MID(SUBSTITUTE(A2,CHAR(10),REPT(" ",100)),ROUNDDOWN(SEARCH("shipping",SUBSTITUTE(A2,CHAR(10),REPT(" ",100)))/100,0)*100,100)),"")
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    130

    Re: Extract a specific line from a excel cell (containing multi line text)

    Yes this formula is working fine for "shipping" but not working for the string "condition" .

  10. #10
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    It wouldn't do that... as you didn't ask for that. This is whay I asked for a representative sample... of your starting point and yourdesired result(s).

    =IFERROR(IF(LEFT(LEFT(A2,SEARCH(CHAR(10),A2)-1),9)="condition",LEFT(A2,SEARCH(CHAR(10),A2)-1),""),"")

  11. #11
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    Ignore previous post. This is a more generic approach.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    130

    Re: Extract a specific line from a excel cell (containing multi line text)

    Thanks Glenn, the solution is perfectly working and thanks alot. Have a good day

  13. #13
    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,137

    Re: Extract a specific line from a excel cell (containing multi line text)

    Cheers... and thanks for the Rep.

  14. #14
    Registered User
    Join Date
    10-07-2021
    Location
    Pakistan
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    17

    Re: Extract a specific line from a excel cell (containing multi line text)

    But when I wanted to extract line or all lines that contain ", United States" in it, this formula returned the line (only one) and it also skipped words from start...
    what I wanted extract: 8490 Hwy 72 W Suite 160, Madison, AL 35758, United States
    what this formula gave: n, AL 35758, United States

    My text in cell A1 was this;
    "57 photos
    CBD American Shaman
    4.8
    (69)
    Vitamin & supplements store
    Overview
    Reviews
    About

    Directions

    Save

    Nearby

    Send to phone

    Share
    ·
    In-store shopping
    ·
    Kerbside pickup
    ·
    Delivery
    8490 Hwy 72 W Suite 160, Madison, AL 35758, United States
    Closed ⋅ Opens 10 am

    See more hours

    cbdala.com
    +1 256-325-1601
    P6XJ+J8 Madison, Alabama, USA
    Send to your phone
    LGBTQ+ friendly
    Identifies as women-owned

    Suggest an edit
    Photos & videos
    All
    Shelf
    Videos
    By owner
    Add a photo
    Questions and answers
    Do you have Delta 8 gummies?
    YES!
    2 years ago


    More questions
    Ask the community
     
    Review summary
    5

    4

    3

    2

    1
    4.8
    69 reviews
    ""Absolutely love the environment and customer service.""
    ""Calm atmosphere and many different products to choose from.""
    ""Friendly people and amazing service ""
    Write a review
    Reviews
    Sort
    All
    products
    20
    questions
    6
    back
    4
    people
    4
    Taylor Satula
    Local Guide · 68 reviews · 19 photos
    a week ago
    NEW
    The staff here is super knowledgeable and friendly. It is very different than the vape shops that carry mystery meat CBD in the area. Much higher quality and they lab test all their products for quality. I get natural chews for my dog here.
    Like
    Share
    Response from the owner a week ago
    We appreciate you Taylor and your kind words! Thank you for your support! We are pleased you see our vision.
    Andrea Lee
    9 reviews
    6 months ago
    very friendly and answered my questions and obviously knew their products. Lovely laid back clean atmosphere. 👍 …
    1
    Share
    Response from the owner 6 months ago
    We are so happy to hear you enjoyed your experience! Thank you!
    Rachel Holder
    32 reviews · 4 photos
    9 months ago
    This is the exact place to start if you’re curious and wanting to get into the world of CBD and Delta. And if you’ve been buying from gas stations and package stores, now is the time to switch to a legit supplier. The product is superior. … More
    1
    Share
    Response from the owner 9 months ago
    WOW Rachel, thank you! We are dedicated to providing the value that our customers deserve. We appreciate your review, it really means a lot to each of us!
    More reviews (66)
    People also search for
    Earth Strong Madison
    5.0(10)
    Herbalist
    Kickn My Habit Vapors & CBD Madison
    4.7(288)
    Vaporizer store
    Sky Zone Vapors/Smoke Shop/CBD
    4.5(304)
    Vaporizer store
    Your CBD Store | SUNMED - Huntsville, AL
    4.8(43)
    Organic shop
    Athens CBD
    4.5(2)
    Cannabis store
     
    Web results
     
    About this data"

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Extract a specific line from a excel cell (containing multi line text)

    Quote Originally Posted by Atif Bhatti View Post
    But when I wanted to extract line or all lines that contain .......


    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #1 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

    Alsao, I suggest you add a SMALL sample WB showing what you have and what you want. What you posted there makes no sense.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 4
    Last Post: 05-20-2020, 02:23 PM
  2. Replies: 3
    Last Post: 03-12-2017, 03:39 PM
  3. [SOLVED] Compare multi-line text cell to data in much larger text file
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2013, 05:19 PM
  4. Macro to copy specific line from text file and paste into specific cell in excel
    By keeneye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:35 AM
  5. Multi-line text box to cell in Excel
    By Smurlos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2009, 07:31 AM
  6. multi-line text file import to excel
    By Waxaholic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2006, 03:45 PM
  7. Replies: 6
    Last Post: 07-12-2005, 04:05 PM

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