+ Reply to Thread
Results 1 to 20 of 20

Find & Replace Issue

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Find & Replace Issue

    Attached is a file that shows external raw data and my desired outcome. It appears there is a tab between in the two. I have researched this, tried Alt+0009 and =Left but I cannot get the result I'm looking for. In 20+ years of using Excel I've never seen this. Can anyone help ?
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    I copied and pasted the character from the formula bar into this formula:

    =LEFT(A2,FIND(" ",A2)-1)

    In other words:

    =LEFT(A2,FIND("copy_pasted_character",A2)-1)
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    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
    53,051

    Re: Find & Replace Issue

    If my understanding is correct, I had no problem with this...
    =LEFT(A2,SEARCH("Ocean",A2)-1)
    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

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

    Re: Find & Replace Issue

    OK based on what you said, as well as what Ali suggested, perhaps I didnt get what you wanted from your sample file?

    You how you want the text before "ocean", that has nothing to do with any spaces?

  5. #5
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Re: Find & Replace Issue

    That worked.... Thank you so much for putting an end to the past few hours of my frustration.... what on earth is "ocean" ?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    You're welcome.

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

  7. #7
    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
    53,051

    Re: Find & Replace Issue

    Quote Originally Posted by M12NIX View Post
    ....what on earth is "ocean" ?
    It is the text after what you wanted extracted...
    A
    B
    2
    OCF OCEAN FRONT JR OCF
    3
    DOME OCEAN FRONT DOM DOME
    4
    SWIM OCEANFRONT SWIM SWIM

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

    Re: Find & Replace Issue

    huh that came out different to what it looked like in the file.

    My suggestion still pulled out what you waned

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    I am beginning to wonder if my suggestion was missed ...

    huh that came out different to what it looked like in the file
    Because there is a tab character in there, which is what I used in my solution.

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

    Re: Find & Replace Issue

    Quote Originally Posted by M12NIX View Post
    That worked.... Thank you so much for putting an end to the past few hours of my frustration.... what on earth is "ocean" ?
    Who's suggestion did you use?

  11. #11
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Re: Find & Replace Issue

    Thank you for your time Ali.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    Here's mine again in the attachment.
    Attached Files Attached Files

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    Whose solution did you use? Ford's will work as long as every entry has "ocean" in it. Mine uses the rogue character instead.

  14. #14
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Re: Find & Replace Issue

    I used yours FDibbins. Ali's makes total sense but I do not know who to add a tab to a formula. I would like to, however. My intent is to add this to my VBA coding but that's for another thread.

  15. #15
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Re: Find & Replace Issue

    I was just thinking that. I will have to use this time and time again. Ford's is a short term solution to this specific issue but yours will help long term. I'm simply at a loss as to how you added the 'tab' into the formula.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    I told you how in post #2.

  17. #17
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Re: Find & Replace Issue

    =LEFT(A2,FIND(" ",A2)-1) (this did not work)

    In other words:

    =LEFT(A2,FIND("copy_pasted_character",A2)-1) (And I'm sorry, I didn't understand the cpc reference.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    Yes, it DOES work - look at the attachment to post #12.

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    Raw Data Desired Result AliGW
    2
    OCF OCEAN FRONT JR OCF OCF
    3
    DOME OCEAN FRONT DOM DOME DOME
    4
    SWIM OCEANFRONT SWIM SWIM SWIM
    Sheet: Sheet1

    Excel 2016 (Windows) 32 bit
    C
    2
    =LEFT(A2,FIND("character_copied_&_pasted_from_the_formula_bar",A2)-1)
    Sheet: Sheet1

    I am not sure what you don't understand about copy and paste: with A2 selected, I copied the space character between OCF and OCEAN from the formula bar and pasted it into my formula betwen the speech marks ("").
    Last edited by AliGW; 06-22-2020 at 01:35 AM.

  19. #19
    Forum Contributor
    Join Date
    03-05-2015
    Location
    London, England
    MS-Off Ver
    2024
    Posts
    124

    Re: Find & Replace Issue

    My apologies. I think I was overly tired as this morning it makes complete sense. Thank you for your time Ali.

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2506 (Windows 11 Home 24H2 64-bit)
    Posts
    91,421

    Re: Find & Replace Issue

    Glad to have helped.

+ 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] Find and replace issue
    By GordonKy42 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-17-2019, 11:29 AM
  2. [SOLVED] VBA Find & Replace apostrophy issue
    By Vivek2705 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-01-2019, 09:03 AM
  3. find and replace issue
    By jen0dorf in forum Excel General
    Replies: 4
    Last Post: 08-03-2016, 07:48 AM
  4. Find and Replace Issue
    By joshuarobbins in forum Excel General
    Replies: 21
    Last Post: 12-23-2015, 06:26 PM
  5. [SOLVED] Issue with FIND/REPLACE Excel 2003 VBA
    By dawatcher in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2013, 06:44 PM
  6. Excel 2007 : 2007 Find and Replace Issue
    By jeremy3 in forum Excel General
    Replies: 3
    Last Post: 02-24-2009, 08:28 PM
  7. [SOLVED] Excel find and replace issue
    By buddyorliz in forum Excel General
    Replies: 3
    Last Post: 06-04-2005, 05:05 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