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

 

REPT(text, number_times)

 
 Repeats text a given number of times.

 textThe text you want to repeat.
 number_timesThe number of times to repeat the text.

 REMARKS
 
  • You can use this function to create a simple histogram on your worksheet.
     
  • If "number_times" = 0, then an empty string ("") is returned.
     
  • If "number_times" is not an integer, it is truncated.
     
  • If "number_times" > 32,767, then #VALUE! is returned.
     
  • If "number_times" < 0, then #VALUE! is returned.
     
  • If "number_times" is not numeric, then #VALUE! is returned.
     
  • This function can be used to fill a cell with a number of instances of a text string.

     EXAMPLES
     
     A
    1=REPT("a",7) = aaaaaaa
    2=REPT("*-",3) = *-*-*-
    3=REPT("~",5) = ~~~~~
    4=REPT("~",5.99) = ~~~~~
    5=REPT("~",32768) = #VALUE!
    6=REPT("~",-5) = #VALUE!
    7=REPT("~","some text") = #VALUE!
     

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

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