Exceljet

Quick, clean, and to the point

Excel REPT Function

Excel REPT function
Summary 

The Excel REPT function repeats characters a given number of times. For example, =REPT("x",5) returns "xxxxx".

Purpose 
Repeat text as specified
Return value 
The repeated text.
Syntax 
=REPT (text, number_times)
Arguments 
  • text - The text to repeat.
  • number_times - The number of times to repeat text.
Usage notes 

The REPT function repeats characters a specified number of times. For example, to repeat "x" five times, you can use the following formula:

=REPT("x",5) // returns "xxxxx"

Inputs to REPT can be variable. In the example shown, REPT is configured to repeat the string in column B using the count in column C.  The formula in D5 is:

=REPT(B5,C5) // returns "-----"

The REPT function can be used in clever ways in more advanced formulas. See links below for specific examples.

Notes

  • Use the REPT function to repeat text a given number of times. This can be useful if you want to fill a cell, or pad values to a certain length.
  • It's possible to build a basic histogram chart using REPT, by translating values directly into a certain number of (repeated) characters.

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.