+ Reply to Thread
Results 1 to 8 of 8

Substitute formula lower and upper case character and long text problem

  1. #1
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Substitute formula lower and upper case character and long text problem

    Hello Forum Leaders,

    I have text in single column such as Text,Text with Numerical,semi colon,back slash and lower and upper case character.


    In Column A2 as a long text. The Formula considered the Text two character only.

    Another one problem The Formulas couldn’t considered some Texts (XXXXX)and Lower and Upper Case character Problems(XXX-xxx).

    File attached for your reference.

    Please help me.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Substitute formula lower and upper case character and long text problem

    The problem/question is unclear.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Re: Substitute formula lower and upper case character and long text problem

    JBeaucaire; Thank you so much for considered my querry.

    QUERY 1

    The following text in column A2.

    ; LOCATIONS/B/12/C ; LOCATIONS/B/13/C ; LOCATIONS/B/15/C ; LOCATIONS/B/18/B ; LOCATIONS/C/05/B ; LOCATIONS/C/06/C ; LOCATIONS/C/13/C ; LOCATIONS/C/19/C ; LOCATIONS/E/04/C ; LOCATIONS/E/06/C

    I have apply the following formula in B2

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(TRIM(LEFT(SUBSTITUTE(TRIM(LEFT(SUBSTITUTE(TRIM(MID(SUBSTITUTE(A37,"LOCATIONS",REPT(" ",99)),99,198)),"M-B",REPT(" ",99)),99)),"WAY",REPT(" ",99)),99)),"Received In",""),"/"," ")),";"," ",2),";"," ")," ","//"))," ","/"),"///"," "),"//","")

    value return is first two text character only such as /B/12/C and B/13/C. But my required format is B/12/C B/13/C B/15/C B/18/B C/05/B C/06/C C/13/C C/19/C E/04/C E/06/C

    Query 2.

    The following text in column A2

    ; AI/// ; MP4-12C/Tralier/01/ ; LOCATIONS/Received In// ;LOCATIONS/A+Q Placing Way// ;LOCATIONS/Q/07/A ; LOCATIONS/Q/07/B ; LOCATIONS/Q/07/FLOOR

    I have apply the following formula in B2. return the value is A+Q/Placing/Way. But My required format is Q/07/A Q/07/B Q/07/FLOOR.

    Please help me.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Substitute formula lower and upper case character and long text problem

    Hello Saxon,

    I received your PM.

    Wow! This workbook contains many more exceptions and inclusions than the previous post.

    I am amazed that my formula actually worked with some of them.

    My formula (column B) is derived by mostly brute force. At that time you were looking for a shorter formula than you currently had.

    I can not think of a way to do this without more brute force and an enormous formula.

    I am not VBA proficient, but my sense is telling me that you might consider such solution and include a complete list of

    those exceptions and inclusions.

    I am afraid that I am out of ideas.

    Sorry.

    Dave
    Dave

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Substitute formula lower and upper case character and long text problem

    I just given a try with my limited knowledge in Regular Expression.

    Unable to post code in the body of this post because of securi blocking.
    Attached Images Attached Images
    Attached Files Attached Files


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Substitute formula lower and upper case character and long text problem

    I'd use the UDF:

    Please Login or Register  to view this content.



  7. #7
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Re: Substitute formula lower and upper case character and long text problem

    FlameRetired , Sixthsense and snb

    Thank you so much for your help and suggestion.its a magic and Unbelievable.....

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Substitute formula lower and upper case character and long text problem

    Quote Originally Posted by :) Sixthsense :) View Post
    Unable to post code in the body of this post because of securi blocking.
    I had the same last week, by editing out various lines of the code I was posting, I found that the block was caused by nesting multiple levels of Replace.

    I got around it by using this method in my code.
    Please Login or Register  to view this content.
    Just had another idea, test post using your code to see if it works.

    ** Code below credited to Sixthsense (see post #5)
    Please Login or Register  to view this content.

+ 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. Replies: 2
    Last Post: 04-18-2014, 04:12 PM
  2. Replies: 7
    Last Post: 04-18-2014, 04:11 PM
  3. Replies: 3
    Last Post: 02-06-2014, 03:44 AM
  4. [SOLVED] Upper & Lower Case Text
    By ASPENCO in forum Excel General
    Replies: 6
    Last Post: 08-13-2013, 02:19 AM
  5. Replies: 2
    Last Post: 12-09-2005, 05:15 AM
  6. Determine whether a character is Upper or Lower case
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2005, 05:50 PM
  7. [SOLVED] Upper & Lower case problem in VBA
    By Rob in forum Excel General
    Replies: 2
    Last Post: 02-10-2005, 04:07 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