Results 1 to 5 of 5

Thread: Trim Text after 3rd Underscore but retain format

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi trankim,

    Welcome to ExcelFox !

    Is it 3rd or 4th ?

    If your data in A1, in B1

    =IF(LEN(A1)-LEN(SUBSTITUTE(A1,"_",""))>=4,LEFT(A1,FIND("|",SUBSTITUTE(A1,"_","|",4))-1),"Text/Logo")

    If it's 3, replace the highlighted 4 with 3

    HTH
    Last edited by Admin; 05-11-2012 at 01:40 PM.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Trim all Cells in a Worksheet - VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 6
    Last Post: 08-21-2015, 08:22 AM
  2. Replies: 3
    Last Post: 06-01-2013, 11:31 AM
  3. Replies: 3
    Last Post: 04-05-2013, 08:24 AM
  4. Convert Text In YYYYMMDD Format To Date Format
    By S M C in forum Excel and VBA Tips and Tricks
    Replies: 1
    Last Post: 02-28-2012, 12:04 AM
  5. Replies: 3
    Last Post: 04-10-2011, 07:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •