+ Reply to Thread
Results 1 to 8 of 8

Text correction function

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-11-2015
    Location
    Jakarta, Indonesia
    MS-Off Ver
    2019
    Posts
    118

    Text correction function

    Hi All

    i have a several SKU which is not standard and need to be corrected,
    encloses my work file with expected text inside
    and i need a formula to convert the text as per my expectations, a single formula which can correct all original text

    thank you
    Didien
    Attached Files Attached Files
    a fool learn from experiences,wise from others

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,249

    Re: Text correction function

    Try, in cell C3:

    Formula: copy to clipboard
    =SUBSTITUTE(LEFT(SUBSTITUTE(SUBSTITUTE(A3," ","|",1)," ",""),FIND("|",SUBSTITUTE(SUBSTITUTE(A3," ","|",1)," ",""))-1) &
    IF(LEN(MID(SUBSTITUTE(SUBSTITUTE(A3," ","|",1)," ",""),FIND("|",SUBSTITUTE(SUBSTITUTE(A3," ","|",1)," ",""))+1,99))=4,"-" &
    MID(MID(SUBSTITUTE(SUBSTITUTE(A3," ","|",1)," ",""),FIND("|",SUBSTITUTE(SUBSTITUTE(A3," ","|",1)," ",""))+1,99),2,2),""),"_","-")
    and copy down.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    02-11-2015
    Location
    Jakarta, Indonesia
    MS-Off Ver
    2019
    Posts
    118

    Re: Text correction function

    Hi TMS

    sorry for late comment, thanks, i have tried to but seems error while run your formula

    however i found the formulas .. thanks anyway

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Text correction function

    Good day Did13n...

    can you post your solution so others could learn/benefit from it.

    thank you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Forum Contributor
    Join Date
    02-11-2015
    Location
    Jakarta, Indonesia
    MS-Off Ver
    2019
    Posts
    118

    Re: Text correction function

    No Problem

    glad to share ..all i did is by added another column as a key ...and use combine substitue, trim and text location
    Attached Files Attached Files
    Last edited by Did13n; 06-27-2016 at 05:34 AM.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,249

    Re: Text correction function

    Thanks for the rep .

    You have the advantage of me in that you know the dependencies.

    However, your formula:
    Formula: copy to clipboard
    =IF(LEFT(C3,2)="FF",SUBSTITUTE(TRIM(LEFT(A3,12)),"_","-")&"-"&IF(LEFT(C3,2)="FF",MID(A3,14,2),""),SUBSTITUTE(TRIM(LEFT(A3,12)),"_","-"))


    could be shorter:
    Formula: copy to clipboard
    =SUBSTITUTE(TRIM(LEFT(A3,12)),"_","-")&IF(LEFT(C3,2)="FF","-"&IF(LEFT(C3,2)="FF",MID(A3,14,2),""),"")


    My formula does work with your test data and has no dependency on column C ... which perhaps explains why it is longer.
    HTML Code: 
    See the attached updated example.

    It may not work with your live data if the structure is different.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-11-2015
    Location
    Jakarta, Indonesia
    MS-Off Ver
    2019
    Posts
    118

    Re: Text correction function

    great ... thanks to shorten formulas @TMS, nice logic !

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,249

    Re: Text correction function

    You're welcome.

+ 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. If Function needed some correction in what I am doing wrong
    By chandannasta in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-05-2014, 03:56 AM
  2. [SOLVED] IF formula correction
    By mra1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2013, 12:36 PM
  3. [SOLVED] Macro Correction Needed to Remove Text and blanks
    By Sweepin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2013, 01:30 AM
  4. Correction in VBA scripts
    By yiannis1925 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-05-2012, 06:11 PM
  5. Address Correction
    By t41310 in forum Excel General
    Replies: 1
    Last Post: 01-01-2012, 09:51 PM
  6. Syntax Correction: Combine text with variable
    By cazooo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-08-2009, 10:36 PM
  7. correction
    By nowfal in forum Excel General
    Replies: 4
    Last Post: 03-24-2006, 02:40 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