+ Reply to Thread
Results 1 to 7 of 7

I want the characters before the -

  1. #1
    Registered User
    Join Date
    10-12-2021
    Location
    Budapest
    MS-Off Ver
    2019
    Posts
    9

    I want the characters before the -

    Hello guyz!

    I have a problem agin. I need to get the characters before the - symbol.

    There's an example: smg153-grt-167445.23

    Before the first - symbol the length of the characters not fix.

    How can I get only before the first symbol the characters?
    Last edited by Rockraizer; 10-22-2021 at 08:23 AM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97 for Mac MS 365
    Posts
    8,701

    Re: I want the characters before the -

    see if this works for you... =LEFT(A1,FIND("-",A1)-1)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    10-12-2021
    Location
    Budapest
    MS-Off Ver
    2019
    Posts
    9
    Quote Originally Posted by Sam Capricci View Post
    see if this works for you... =LEFT(A1,FIND("-",A1)-1)
    Sadly I'm already tried that and I've got a #N/A error.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97 for Mac MS 365
    Posts
    8,701

    Re: I want the characters before the -

    you want smg153, correct?
    Do you need to replace the commas with semicolons for your region? like =LEFT(A3655;FIND("-";A3655)-1)
    it worked for me with that example, perhaps post a short sample workbook and if it is any question about what you want as an output then type in a few examples of what you want.

  5. #5
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,452

    Re: I want the characters before the -

    Budapest ! regional settings !!!
    Replace "," with ";" ???
    Please Login or Register  to view this content.
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,994

    Re: I want the characters before the -

    Try

    =LEFT(A2,FIND("-",A2)-1)
    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
    Registered User
    Join Date
    10-12-2021
    Location
    Budapest
    MS-Off Ver
    2019
    Posts
    9

    Re: I want the characters before the -

    Thanks all of you guyz! That was my mistake because of the the regional setting as your wrote!

+ 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] Search string for specific characters, then output characters that reflect range
    By jackmaca in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-19-2020, 09:13 AM
  2. [SOLVED] Remove characters from cells if the have non data and characters as per attached sheet
    By khanaran in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-17-2019, 02:35 PM
  3. [SOLVED] Replace accented characters in worksheet name to regular characters
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2017, 10:59 AM
  4. VBA Characters() Function Fails when the Cell Content Exceeds 261 Characters
    By :) Sixthsense :) in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-07-2016, 06:37 AM
  5. Replies: 2
    Last Post: 02-09-2016, 11:00 AM
  6. [SOLVED] VBA, remove all characters within a string, except numerical characters and full stops
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-25-2015, 09:24 PM
  7. Replies: 11
    Last Post: 01-23-2013, 02:04 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