+ Reply to Thread
Results 1 to 2 of 2

How do extract text after last dash? (Mid formula??)

  1. #1
    Registered User
    Join Date
    09-21-2014
    Location
    New York, NY
    MS-Off Ver
    2010
    Posts
    5

    How do extract text after last dash? (Mid formula??)

    Hi, I have a long list of values that look like “US - CA - Los Angeles” or “France - Paris”. What formula can I use to isolate the city (everything after the last dash and space?)

  2. #2
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: How do extract text after last dash? (Mid formula??)

    Hi, there are various methods do it depending on your volume of datasets, if it is a one-off extraction then

    =TRIM(RIGHT(SUBSTITUTE(A2,"-",REPT(" ",LEN(A2))),LEN(A2)))


    If you have massive amount of records need to transform, and also constantly new data flow in for updating, then Power Query (just build the query once and updating just right-click and refresh) is the more efficiency method ( see my simple query in Power Query Editor)


    Note:- you can download the add-On of Power Query to your Excel 201
    Attached Files Attached Files
    Christopher Yap

+ 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] extract number after dash
    By L.LEE in forum Excel General
    Replies: 2
    Last Post: 10-12-2018, 12:35 AM
  2. Replies: 4
    Last Post: 08-01-2018, 12:27 PM
  3. [SOLVED] How two extract text behind last dash"-" from multiple dash "-" containing text?
    By nabinprd1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2018, 12:16 PM
  4. [SOLVED] extract text after second dash
    By L.LEE in forum Excel General
    Replies: 3
    Last Post: 06-03-2018, 03:25 AM
  5. Extract Text after hypen or dash
    By MarkO'Donnell in forum Excel General
    Replies: 1
    Last Post: 11-06-2017, 08:35 PM
  6. Nw how do i extract text from a text seperated by a dash.
    By all4excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-26-2007, 05:30 AM
  7. understanding dash dash in a excel formula
    By ldebner in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-31-2005, 10:05 AM

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