none
Difference Between LSet() and Left() ? RRS feed

Answers

  • I found the answer in the LSet page. Here is the essential difference between Left and LSet:

    If Source is shorter than LengthLSet adds spaces to the right end of the returned string to produce the appropriate length.

    That's a big difference, and potentially very useful. 

    Both functions return the leftmost characters of the input-string, if you pass a Length parameter that is less than the length of the input-string. 

    Btw, Deepak, your Left link is the wrong Left for this thread. I'm referring to the VBA Left function. The page you linked is for worksheet function Left. 


    • Marked as answer by johny w Monday, May 30, 2016 8:15 PM
    • Edited by johny w Wednesday, June 1, 2016 9:07 PM
    Monday, May 30, 2016 8:14 PM

All replies

  • Hi johny w,

    The Microsoft Excel LEFT function allows you to extract a substring from a string, starting from the left-most character.

    Syntax

    The syntax for the LEFT function in Microsoft Excel is:

    LEFT( text, [number_of_characters] )

    Lset Function Returns a left-aligned string containing the specified string, adjusted to the specified length.

    please visit the link below to get more information.

    LSet Function

    LEFT function

    Regards

    Deepak

    ,

    ,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, May 26, 2016 2:56 AM
    Moderator
  • I found the answer in the LSet page. Here is the essential difference between Left and LSet:

    If Source is shorter than LengthLSet adds spaces to the right end of the returned string to produce the appropriate length.

    That's a big difference, and potentially very useful. 

    Both functions return the leftmost characters of the input-string, if you pass a Length parameter that is less than the length of the input-string. 

    Btw, Deepak, your Left link is the wrong Left for this thread. I'm referring to the VBA Left function. The page you linked is for worksheet function Left. 


    • Marked as answer by johny w Monday, May 30, 2016 8:15 PM
    • Edited by johny w Wednesday, June 1, 2016 9:07 PM
    Monday, May 30, 2016 8:14 PM