REPT(text, number_times)

Returns the text string repeated a 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.
* You can use the LEN function to return the number of characters in a text string.
* You can use the CLEAN function to return the text string with all the non-printable characters removed.
* You can use the TRIM function to remove all the extra spaces from the beginning, middle and end.
* For the Microsoft documentation refer to support.office.com

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

1 - What text string is returned when you repeat the "a" character, 7 times.
2 - What text string is returned when you repeat the "*-" character, 3 times.
3 - What text string is returned when you repeat the "~" character, 5 times.
4 - What text string is returned when you repeat the "~" character, 5.99 times. This is not an integer and is truncated.
5 - What text string is returned when you repeat the "abc" characters, 3 times.
6 - What text string is returned when you repeat the "~" character, 32,768 times.
7 - What text string is returned when you repeat the "~" character, -5 times.
8 - When the "number_times" argument is not numeric.

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top