+ Reply to Thread
Results 1 to 4 of 4

Substring from right

  1. #1
    Registered User
    Join Date
    01-16-2016
    Location
    Stockholm
    MS-Off Ver
    Office 2012
    Posts
    2

    Substring from right

    Below is an example of data in a cell

    111-333-222

    I have tried several formulas in order to be able to substring everything from right until the first dash (first "-" from right).

    In above case I would like to be able to only return "222".

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Substring from right

    assuming your data is in A1 and your data is always separated by "-" then in B1 copy paste below
    =TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",50)),50))
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Registered User
    Join Date
    01-16-2016
    Location
    Stockholm
    MS-Off Ver
    Office 2012
    Posts
    2

    Re: Substring from right

    Thanks! Works well!

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Substring from right

    you are welcome freddie !


    if this resolves your query you can mark your thread as solved.(go through signature lines in post #2)

+ 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. Macro to search cells for substring and replace contents of cell if substring is found
    By robbyvegas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2015, 06:40 AM
  2. [SOLVED] Match substring
    By aaronb1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2014, 11:58 PM
  3. Searching for substring
    By mjohn99 in forum Excel General
    Replies: 8
    Last Post: 12-04-2013, 07:59 PM
  4. Search substring within range, report the substring found
    By Brooke1578 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2012, 03:56 PM
  5. Search for SubString
    By Hallet in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2012, 04:38 AM
  6. [SOLVED] Extract Substring, then Ignore that Substring, while collecting data from Other substrings
    By Sameki121 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-17-2012, 05:21 PM
  7. sum a value(substring) in a cell
    By tnchong in forum Excel - New Users/Basics
    Replies: 17
    Last Post: 05-18-2009, 03:55 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