+ Reply to Thread
Results 1 to 8 of 8

Help needed with expressions with substring expressions.

  1. #1
    Registered User
    Join Date
    06-21-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Help needed with expressions with substring expressions.

    1. If SUBSTRING() is a function that returns part of a text string based on a specific starting position and a specific number of characters, such that SUBSTRING('Mt. Rushmore',5,4) = 'Rush', write a SUBSTRING() expression to isolate America's third president's first name from the following string: 'Jefferson, Thomas



    2. If LEFT('dog',1) = 'd' and RIGHT('dog',2) = 'og', then what is: LEFT(RIGHT('transparent',7),5)?
    9.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937

    Re: Help needed with expressions with substring expressions.

    Just like algebra, you start with the innermost parentheses:
    here's a hint without the answer:
    1. Do the RIGHT() fn
    2. Use the LEFT on the results of the RIGHT....
    Last edited by protonLeah; 06-21-2015 at 03:24 PM.
    Ben Van Johnson

  3. #3
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,897

    Re: Help needed with expressions with substring expressions.

    I think that the problem may be that you are trying to get these to work with single quotation marks ' when you need double quotation marks "

  4. #4
    Registered User
    Join Date
    06-21-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Help needed with expressions with substring expressions.

    Thanks jeteMc. Could you elaborate. how would the formula look?

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,897

    Re: Help needed with expressions with substring expressions.

    Quote Originally Posted by sbell1234 View Post
    ...what is: LEFT(RIGHT('transparent',7),5)
    Please Login or Register  to view this content.

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

    Re: Help needed with expressions with substring expressions.

    Remember that in the nested functions, the functions are evaluated from inside out.
    So in this formula you are using two functions Left and Right, where Right is used inside the Left function so it will be evaluated first.
    In the Left function there are two arguments you need to pass within it i.e. Left(Text,No. of left most Characters you want to extract from the Text), so instead of passing the Text or a cell reference as a first argument in the Left function, you are passing another function Right as an argument in place of Text, so whatever your Right function returns would be used as the first argument for the left function.
    If you look at your Right function =RIGHT("transparent",7), it will return 7 characters from the right of the string transparent i.e. sparent.
    So you Left function would become like this Left("sparent",5) and that will return the 5 characters from the left of the string sparent i.e. spare
    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.

  7. #7
    Registered User
    Join Date
    06-21-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Help needed with expressions with substring expressions.

    thanks sktneer. Much appreciated!

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

    Re: Help needed with expressions with substring expressions.

    You're welcome.

    If that takes care of your original question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

+ 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. Regular Expressions in VBA
    By BS Singh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 03:29 PM
  2. Regular Expressions in VBA
    By samualt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-08-2011, 11:34 PM
  3. Regular Expressions
    By mattdick in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2009, 06:33 PM
  4. [SOLVED] Substring in excel? How about regular expressions?
    By Samuel in forum Excel General
    Replies: 8
    Last Post: 05-22-2006, 11:50 AM
  5. [SOLVED] Regular Expressions in VBA?
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-10-2005, 02:06 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