REPT Function
Master the REPT function to repeat text strings any number of times. Create data bars, patterns, and visual indicators with examples and solutions.




=REPT(text, number_times)
Practical Examples
Basic Text Repetition
Repeat a simple text string multiple times
In-Cell Bar Chart
Create a visual bar chart using repeated block characters
Star Rating System
Display product ratings using filled and empty stars
Progress Indicator with Percentage
Show project completion with blocks and percentage
Dynamic Padding for Fixed Width
Pad product codes to ensure consistent 10-character width
Creating Separator Lines
Generate dynamic separator lines for reports
Common Errors and Solutions
Result would exceed 32,767 characters
The text repetition would create a string longer than Excel's maximum cell content limit of 32,767 characters
1. Reduce the number of repetitions 2. Use shorter text to repeat 3. Split the output across multiple cells using multiple REPT functions 4. Consider if you really need that many repetitions
Calculate the expected output length before using REPT: text_length × repetitions should be less than 32,767
Example:
REPT returns blank/empty string
The number_times parameter is 0, negative, or the text parameter is empty
1. Check that number_times is positive and greater than zero 2. Verify the text parameter contains actual content 3. Use IF to provide alternative when count is zero 4. Ensure cell references aren't pointing to empty cells
Always validate inputs with IF statements when using dynamic values
Example:
Excel doesn't recognize the function
Typically a typo in the function name (REPEAT instead of REPT) or missing quotes around text
1. Ensure you're using REPT, not REPEAT or RPT 2. Check that text strings are enclosed in quotes 3. Verify the function is available in your Excel version 4. Check for unclosed parentheses
Use Excel's autocomplete feature to ensure correct function names
Example:
Numbers showing as text after using REPT
REPT always returns text, even when repeating numbers, which can affect calculations
1. Use VALUE() to convert back to numbers if needed 2. Multiply by 1 to force number conversion 3. Use TEXT() function for proper number formatting 4. Reconsider if REPT is the right function for numerical operations
Remember that REPT output is always text format
Example:
Special characters not displaying correctly
Font doesn't support the Unicode characters being repeated, or character encoding issues
1. Change cell font to one supporting Unicode (like Arial Unicode MS) 2. Use CHAR() function for special characters 3. Try alternative characters that are more widely supported 4. Check regional settings and character encoding
Test special characters in your target environment before widespread use
Example:
Best Practices and Advanced Techniques
When creating data bars, always use ROUND or INT with your division to ensure whole number repetitions. =REPT("█", ROUND(A1/10, 0)) prevents partial repetitions that don't make visual sense.
Instead of copying special characters, use CHAR codes for consistency across systems. CHAR(9733) for ★, CHAR(9632) for ■, CHAR(9644) for ▌. This ensures characters display correctly regardless of copy-paste issues.
REPT with very large repetitions (>1000) can slow down spreadsheet recalculation. For massive repetitions, consider whether you really need all characters or if a representative sample would work.
Define commonly used REPT patterns as named formulas. For example, create 'StarRating' as =REPT("★",$A1)&REPT("☆",5-$A1) and reuse throughout your workbook.
Use REPT to show relative values that automatically scale. Divide by MAX of the range to create proportional bars: =REPT("▓", 10*A1/MAX($A$1:$A$10))
Use Unicode block elements for professional-looking charts: █ (U+2588) for full blocks, ▓ (U+2593) for dark shade, ░ (U+2591) for light shade. These create smoother visual gradients.
Need Help with REPT Function?
Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.
Example Excel formula:
Related Formulas
Master the CONCAT function to combine text from multiple cells efficiently. Learn syntax, examples, and solutions to common errors in Excel and Google Sheets.


Master CONCATENATE to join text in Excel and Google Sheets. Learn syntax, examples, errors, and modern alternatives like CONCAT and TEXTJOIN.


Master the LEN function to count characters in text strings. Learn data validation, text analysis, and formatting in Excel and Google Sheets.


Master TEXTJOIN to combine text from multiple cells with custom delimiters. Merge data, skip blanks, and create lists in Excel 2019+ and Sheets.

