Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Text > LEFT

 

LEFT(text [,num_chars])

 
 The first or left most character (or characters) in a text string.

 textThe text string that contains the characters you want to extract.
 num_charsThe number of characters you want to extract.

 REMARKS
 
  • If "num_chars" < 0, then #VALUE! is returned.
     
  • If "num_chars" > the length of the "text", then "text" is returned.
     
  • If "num_chars" is left blank, then 1 is used.
     
  • Any blank spaces are counted as individual characters.
     
  • If the text contains any leading or trailing spaces it may be worth using the TRIM() function to ensure you get the expected result.
     
  • There is also a LEFTB() function which can be used with languages that use the double-byte character set.

     EXAMPLES
     
     A
    1=LEFT("Better Solutions",6) = Better
    2=LEFT("Better",1) = B
    3=LEFT("Solutions") = S
    4=LEFT("Be More Productive",7) = Be More
    5=LEFT("Be More Productive",100) = Be More Productive
    6=LEFT(" word",5) = " word"
    7=LEFT(TRIM(" word"),5) = word
    8=LEFT("Better Solutions",-5) = #VALUE!
    9=LEFT("Better Solutions","Be More Productive") = #VALUE!
     

     Functions - L | Index - L | Text Manipulation | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top