+ Reply to Thread
Results 1 to 14 of 14

Insert <tab> in a phrase with condition

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Thumbs up Insert <tab> in a phrase with condition

    Hi Good morning!

    I have a table of contents!

    eg:
    Mr.Jesus P Perez 995 656 55 4554 949 4
    Ms.KirstenC Marrero E 49 8 4 6 4 67 655 7
    Mrs.Faye W Smith 9 69 6F5 74 8675 7 46 6
    Mr.Herbert V Johnson 55 6 4 4 674 6 47 4 4787
    Mr.Daniel J Thomoson 79A 48F 8 4 7668 8 6

    Result :

    Mr.Jesus P Perez<tab> 995 656 55 4554 949 4
    Ms.KirstenC Marrero<tab> E 49 8 4 6 4 67 655 7
    Mrs.Faye W Smith<tab> 9 69 6F5 74 8675 7 46 6
    Mr.Herbert V Johnson<tab> 55 6 4 4 674 6 47 4 4787
    Mr.Daniel J Thomoson<tab> 79A 48F 8 4 7668 8 6

    Suggestion: Insert a <tab> or <any special character> after the 4th word which starts with CAPS (regardless its followed by a Alphabet or Numeric).

    Appreciate your early reply!

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Insert <tab> in a phrase with condition

    Try this formula

    =LEFT(A5,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A5&1234567890))-2)&"<tab>"&SUBSTITUTE(A5,LEFT(A5,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A5&1234567890))-2),"")

    A
    B
    1
    Mr.Jesus P Perez 995 656 55 4554 949 4 Mr.Jesus P Perez<tab> 995 656 55 4554 949 4
    2
    Ms.KirstenC Marrero E 49 8 4 6 4 67 655 7 Ms.KirstenC Marrero E<tab> 49 8 4 6 4 67 655 7
    3
    Mrs.Faye W Smith 9 69 6F5 74 8675 7 46 6 Mrs.Faye W Smith<tab> 9 69 6F5 74 8675 7 46 6
    4
    Mr.Herbert V Johnson 55 6 4 4 674 6 47 4 4787 Mr.Herbert V Johnson<tab> 55 6 4 4 674 6 47 4 4787
    5
    Mr.Daniel J Thomoson 79A 48F 8 4 7668 8 6 Mr.Daniel J Thomoson<tab> 79A 48F 8 4 7668 8 6
    Last edited by AlKey; 08-01-2014 at 11:35 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Insert <tab> in a phrase with condition

    Or this.....

    Assuming your string is in A1, then
    Please Login or Register  to view this content.
    This will add a ":" at the desired place in the string.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Insert <tab> in a phrase with condition

    How about this one

    =REPLACE(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&1234567890))-1,1,"<tab> ")

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Insert <tab> in a phrase with condition

    why not just this? Seems a lot simpler.

    Please Login or Register  to view this content.
    Excel doesn't seem to like having a tab in a cell so the CHAR(9) might need to be chnaged to " " if you just want a larger space.

  6. #6
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Insert <tab> in a phrase with condition

    Thank you and appreciate your early reply!

    I found a prob at (Sl.No: 2) :

    2 Ms.KirstenC Marrero E 49 8 4 6 4 67 655 7 Ms.KirstenC Marrero E<tab> 49 8 4 6 4 67 655 7

    It was suppose to add a <tab> after "Marrero" which is the 4th word (sorry for not have a space Between "KirstenC" but actually it has to be treated as 2 words. <tab> should appear before CAP "E"


    Thank you for the affort!... await your reply

  7. #7
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Insert <tab> in a phrase with condition

    Quote Originally Posted by Crooza View Post
    why not just this? Seems a lot simpler.

    Please Login or Register  to view this content.
    Excel doesn't seem to like having a tab in a cell so the CHAR(9) might need to be chnaged to " " if you just want a larger space.
    Thanks for the reply!
    Appreciate your effort


    It should not be counted with spaces but with CAPS (4th caps), as the Second record :
    2 Ms.KirstenC Marrero E 49 8 4 6 4 67 655 7 Ms.KirstenC Marrero E<tab> 49 8 4 6 4 67 655 7

    It was suppose to add a delimiter after "Marrero" which is the 4th word (sorry for not have a space Between "KirstenC" but actually it has to be treated as 2 words) conversion error. delimiter should appear before CAP "E"

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Insert <tab> in a phrase with condition

    Thanks Crooza with your help it should've been like this

    =SUBSTITUTE(A1," ","<tab>",4)

  9. #9
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Re: Insert <tab> in a phrase with condition

    Quote Originally Posted by sktneer View Post
    Or this.....

    Assuming your string is in A1, then
    Please Login or Register  to view this content.
    This will add a ":" at the desired place in the string.

    Thanks a lot!

  10. #10
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Insert <tab> in a phrase with condition

    I know the complex formulas above are trying to address your capital letter issue but my formula should work for the problem you posted above unless I'm missing something. Seems you just want to pick up the third space in each example

    Please Login or Register  to view this content.
    I've changed to using a colon for this example

  11. #11
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Insert <tab> in a phrase with condition

    Quote Originally Posted by kjxavier View Post
    Thanks for the reply!
    Appreciate your effort


    It should not be counted with spaces but with CAPS (4th caps), as the Second record :
    2 Ms.KirstenC Marrero E 49 8 4 6 4 67 655 7 Ms.KirstenC Marrero E<tab> 49 8 4 6 4 67 655 7

    It was suppose to add a delimiter after "Marrero" which is the 4th word (sorry for not have a space Between "KirstenC" but actually it has to be treated as 2 words) conversion error. delimiter should appear before CAP "E"
    Quote Originally Posted by Crooza View Post
    I know the complex formulas above are trying to address your capital letter issue but my formula should work for the problem you posted above unless I'm missing something. Seems you just want to pick up the third space in each example

    Please Login or Register  to view this content.
    I've changed to using a colon for this example
    Ok I see your problem now. ;-)

  12. #12
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Insert <tab> in a phrase with condition

    Quote Originally Posted by Crooza View Post
    Seems you just want to pick up the third space in each example
    No I am searching for 4th space but in row2 creating one extra space to get the desired position where special character needs to be added.

  13. #13
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Insert <tab> in a phrase with condition

    @ kjxavier,

    You're welcome. Thanks for the feedback.

  14. #14
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Insert <tab> in a phrase with condition

    There is a leading space in each cell. LOL. I just noticed it.

+ 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. insert row in tab 2 upon insert row in tab1 if condition matches
    By mbaconqueror in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2012, 12:53 AM
  2. Function to return text from phrase X to phrase Y
    By razr in forum Excel General
    Replies: 3
    Last Post: 05-06-2009, 05:52 PM
  3. Insert row before specific phrase
    By excellar in forum Excel General
    Replies: 2
    Last Post: 08-21-2008, 11:19 AM
  4. [SOLVED] Insert row if condition met
    By Acct Supr - DCTC in forum Excel General
    Replies: 1
    Last Post: 10-06-2005, 02:05 PM
  5. [SOLVED] Insert Row Condition
    By James in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-06-2005, 03:06 PM

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