+ Reply to Thread
Results 1 to 8 of 8

Substitute Text String

  1. #1
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Substitute Text String

    I would like to take a string such as R0-H6-D2 and return a number (1-4) based on one of four values for R, H and D in a separate column for each. The attachment should make what I am trying to do clearer. Any help will be much appreciated!
    Attached Images Attached Images
    Last edited by javeds; 01-12-2014 at 12:28 AM.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Substitute Text String

    Your attachment is not valid ! Please attach the book again
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Substitute Text String

    I have updated the attachment. Hope it is clearer now.

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Substitute Text String

    Find the attached !


    If this helps don't forget to click the star icon(add rep icon) in the bottom left corner of my post!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Substitute Text String

    Quote Originally Posted by hemesh View Post
    Find the attached !


    If this helps don't forget to click the star icon(add rep icon) in the bottom left corner of my post!
    Hi Hemesh,

    Thanks for the help. Yes, your formula does what I wanted to do and I have given you the star! Here is a similar way to get the same results that I found out subsequent to my post:
    For "R" =LOOKUP(MID(I34,2,2),{"0-","15","30","45";"1","2","3","4"})
    For "H" =LOOKUP(MID(I44,6,1),{"6","7","8","9";"1","2","3","4"})
    For "D" =LOOKUP(MID(I39,9,1),{"2","4","6","8";"1","2","3","4"})

    Thanks again!

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Substitute Text String

    Here is another answer for this problem.
    It uses the letters in the 1 row to lookup.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Substitute Text String

    Quote Originally Posted by MarvinP View Post
    Here is another answer for this problem.
    It uses the letters in the 1 row to lookup.
    Thanks, MarvinP!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Substitute Text String

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. want help to substitute all letters in a string at the same time
    By trickyricky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2013, 06:57 PM
  2. Summing of values within a string using LEN and Substitute
    By partom24 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-25-2013, 02:27 PM
  3. [SOLVED] Substitute a text string with multiple values
    By dihris in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2012, 03:25 PM
  4. Substitute: any particular letter in string
    By daffykyle in forum Excel General
    Replies: 6
    Last Post: 05-26-2011, 09:11 AM
  5. How to use a substitute formula to substitute text entries to a different text entry
    By andybocchi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-01-2010, 07:50 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