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

 

RIGHT(text [,num_chars])

 
 The last or right 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 RIGHTB() function which can be used with languages that use the double-byte character set.

     EXAMPLES
     
     A
    1=RIGHT("Better Solutions",9) = Solutions
    2=RIGHT("Better",1) = r
    3=RIGHT("Solutions",1) = s
    4=RIGHT("Be More Productive",15) = More Productive
    5=RIGHT("Be More Productive",100) = Be More Productive
    6=RIGHT("word ",5) = "word "
    7=RIGHT(TRIM("word "),5) = word
    8=RIGHT("Better Solutions",-50) = #VALUE!
    9=RIGHT("Better Solutions","Be More Productive") = #VALUE!
     

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

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