+ Reply to Thread
Results 1 to 15 of 15

Replace Character and Convert to Proper Case

  1. #1
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Replace Character and Convert to Proper Case

    Hi,

    Can anyone help me to solve to replace the old text with new. Below is the text for example. I have attached the file for more information.
    Old Text- 749100- -Vehicle Running-25115:FUDDRUCKERS ANDALUS-2, CUTTK
    Replace with - 749100- -Vehicle Running | 25115-Fuddruckers Andalus-2, Cuttk

    Regards,
    Barieq
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    Try

    =SUBSTITUTE(SUBSTITUTE(A2,"-"," | ",3),":","-")


    EDIT: missed second substitution.
    Last edited by JohnTopley; 03-15-2018 at 06:49 AM.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    =proper(substitute(substitute(a2,"-"," | ",3),":","-"))

  4. #4
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    Thanks, Excellent. Could you please convert to proper only after this part | 25115-Fuddruckers Andalus-2, Cuttk

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    Converting all to proper leaves the part before "| 25115-Fuddruckers Andalus-2, Cuttk" unchanged based on your sample.
    .

  6. #6
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    But when I Convert this text 192300- -EMA-25115:FUDDRUCKERS ANDALUS-2, CUTTK, it replaces into this 192300- -Ema | 25115- -Fuddruckers Andalus-2, Cuttk.

    Actually, I don't want EMA to Ema

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    I used 2 steps:

    in B2

    =SUBSTITUTE(SUBSTITUTE($A2,"-"," | ",3),":","-")

    in C2

    =LEFT($B2,FIND(" |",$B2))&PROPER(MID($B2,FIND(" |",$B2),255))
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    Thanks, Is there any way to combine the formula to one

  9. #9
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    Dear John,

    Is it possible to get the result in macro
    Last edited by Barieq; 03-15-2018 at 08:08 AM.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    A "monster" ....

    =LEFT(SUBSTITUTE(SUBSTITUTE($A2,"-"," | ",3),":","-"),FIND(" |",SUBSTITUTE(SUBSTITUTE($A2,"-"," | ",3),":","-")))&PROPER(MID(SUBSTITUTE(SUBSTITUTE($A2,"-"," | ",3),":","-"),FIND(" |",SUBSTITUTE(SUBSTITUTE($A2,"-"," | ",3),":","-")),255))

  11. #11
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    Thanks John for effort, you are right indeed it is a monster. I have posted the thread to VBA.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    Are there always 5 digit number before the colon ?

  13. #13
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    yes, it is always 5 digit

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Replace Character and Convert to Proper Case

    Try

    =LEFT(A2,FIND(":",A2)-7)&PROPER(SUBSTITUTE(SUBSTITUTE(MID($A2,FIND(":",A2)-6,255),"-"," | ",1),":","-"))

    EDIT: new formula
    Last edited by JohnTopley; 03-15-2018 at 09:11 AM.

  15. #15
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    507

    Re: Replace Character and Convert to Proper Case

    Thanks, for your excellent formula.

+ 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. Upper Case or Proper Case help
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-24-2013, 02:56 PM
  2. [SOLVED] Need the proper syntax to use Case/Select Case in vba properly.
    By rbion in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2013, 02:34 PM
  3. Replies: 3
    Last Post: 10-30-2009, 04:00 PM
  4. Proper Case not doing letter after a character
    By dugong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2008, 12:34 PM
  5. Using VBA to convert text to proper case
    By Darlo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2007, 05:59 PM
  6. [SOLVED] excel'03 how to convert a column from upper case to proper case
    By sharie palmer in forum Excel General
    Replies: 1
    Last Post: 01-30-2006, 07:55 PM
  7. [SOLVED] Excel: How do I change all upper case ss to proper case?
    By Moosieb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-12-2006, 08:50 PM
  8. [SOLVED] Changing Upper case to Proper Case
    By Mountain in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2005, 07:06 PM

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