+ Reply to Thread
Results 1 to 6 of 6

Remove cell values after a hyphen

  1. #1
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Remove cell values after a hyphen

    Hey guys,

    I am trying to remove numerical values that comes after a hyphen in my file. I have different values with more than one hyphen in a cell. I tried the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This formula finds every hyphen value in a given cell and removes numbers following the hyphens. The issue with this is that I only need the last hyphen in a cell to be identified and the numbers following that hyphen to be removed. For ex: if a cell value is 123-456-789, I want to get the result as 123-456.

    I've attached a sample file showing my expected output for different types of values I have in my actual file.

    Any help is appreciated

    Thanks in Advance

    VJ
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,122

    Re: Remove cell values after a hyphen

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove cell values after a hyphen

    I am sorry, I accidentally saved the post before attaching the file. I did it afterwards and you should be able to see the file now. It is just a simple file with three different values to show the different kinds of data in my file. I will give the above formula a try and update here. Thanks

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,122

    Re: Remove cell values after a hyphen

    you should be able to see the file now
    Yup I noticed that after I posted & made a slight tweak to the formula in post#2 so you might want to check you have the right formula.

  5. #5
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Remove cell values after a hyphen

    Quote Originally Posted by Fluff13 View Post
    Yup I noticed that after I posted & made a slight tweak to the formula in post#2 so you might want to check you have the right formula.
    The formula totally works. Thanks for taking the time to help. Really appreciate it.

    VJ

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,122

    Re: Remove cell values after a hyphen

    You're welcome & thanks for the feedback.

+ 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] Formula To Remove Hyphen But Keep Space
    By jo15765 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2017, 08:55 PM
  2. Replies: 4
    Last Post: 08-11-2016, 11:25 AM
  3. [SOLVED] Remove leading zero's after hyphen
    By jprlimey in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-07-2016, 11:03 AM
  4. Remove numbers followed by hyphen in text column
    By grantman7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-23-2015, 11:54 PM
  5. Macro to remove hyphen from number
    By AZJimBird in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2013, 03:19 AM
  6. Replies: 4
    Last Post: 03-02-2005, 12:06 PM
  7. [SOLVED] Need to remove hyphen in group of #s
    By [email protected] in forum Excel General
    Replies: 2
    Last Post: 03-02-2005, 11:06 AM

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