+ Reply to Thread
Results 1 to 15 of 15

Extract Data from Column, which contain character "/" and in Left side of character "-"

  1. #1
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Extract Data from Column, which contain character "/" and in Left side of character "-"

    Data is in B4:B500, something like this :

    12345678/001-name1
    text1
    22558877/089-name2
    33445588/012-name3
    text2
    text3
    11992288/004-name3

    Result should be consecutive in Column C
    12345678/001
    22558877/089
    33445588/012
    11992288/004

    If possible without help column (I have too many already)
    Last edited by ionelz; 05-10-2020 at 10:04 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Maybe it's clear for you, but just to make sure.
    Is it the data between the / and the - that you want to extract?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Hi ionelz,

    I'd be looking at an Advanced Filter using a criteria of */* and put the results in column C. Does that make sense?
    Then I'd do a Left() function to get text left or the "-".
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    The expected results are in the second half of the post.

    If you want to update the column itself then you will need VBA.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Keelbellah,
    If you look at Results in my first post, EXTRACTED are ONLY Rows which contain "/", and in that extracted rows, data in LEFT side of "-"
    Last edited by ionelz; 05-10-2020 at 12:11 PM.

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    I saw that but you should clearly mention what YOU ate seeking not what others assume
    Don’t let others guess or think up things you probably don’t want done

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    With respect, Keebllah, the OP was clear in the opening post about the results he is looking for:

    Result should be consecutive in Column C
    12345678/001
    22558877/089
    33445588/012
    11992288/004
    He also mentioned not wanting a helper column, which is why I made the comment about VBA.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Please try at C4

    =IFERROR(LEFT(INDEX(B:B,AGGREGATE(15,6,ROW($B$4:$B$500)/ISNUMBER(SEARCH("/*-",$B$4:$B$500)),ROWS(C$4:C4))),12),"")

  9. #9
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Bo_Ry, like always, billions of thanks !!!
    How many times so far, you just came, read the question, and answer !?!?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  11. #11
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    One moment please, I will ask him another question if possible !
    Bo, please look in Column C
    I have replaced fixed "12" with Floating FIND("-",B2)-1 because data in B have leading spaces
    Now, I do not get the result consecutive (aggregate) in C
    Attached Files Attached Files
    Last edited by ionelz; 05-10-2020 at 01:55 PM.

  12. #12
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Please add trim

    =IFERROR(LEFT(TRIM(INDEX(B:B,AGGREGATE(15,6,ROW($B$2:$B$17)/ISNUMBER(SEARCH("/*-",$B$2:$B$17)),ROWS(C$2:C2)))),12),"")

  13. #13
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Thank you, problem solved !
    If you could EXTRACT in Column C, as they are in B (so without TRIM) that would Help me, COUNT the Leading spaces in E
    I need that column E, and I am not sure if I can do that based on data from B
    But thank you very much
    Attached Files Attached Files

  14. #14
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    D2
    =iferror(index(left($b$2:$b$17,find("-",$b$2:$b$17)-1),aggregate(15,6,row($b$2:$b$17)/isnumber(search("/*-",$b$2:$b$17)),rows(d$2:d2))-row($b$1)),"")

  15. #15
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Data from Column, which contain character "/" and in Left side of character "-

    Thank you so 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. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  2. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  3. Replies: 1
    Last Post: 08-10-2014, 01:22 PM
  4. [SOLVED] Trim left, but only if the first 3 character start with "The"
    By firstsgt1978 in forum Excel General
    Replies: 7
    Last Post: 03-25-2014, 11:47 AM
  5. [SOLVED] how to replace the "Alt-Enter" character in a cell with sway "@"
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-04-2014, 05:55 AM
  6. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  7. Replies: 5
    Last Post: 06-26-2006, 09:23 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