REPT Function (OpenOffice Calc)
Learn the REPT function in Apache OpenOffice Calc: Repeats text a given number of times.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
- Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
REPT repeats a text fragment a specified number of times and joins the copies with no automatic separator. It is useful for small text indicators, padding and simple visual aids. The result is text; it is not a numeric multiplication and cannot replace the underlying quantitative data.
Syntax and arguments
=REPT(text; count)
Both arguments are required. text is the fragment copied and count is the number of repetitions. Use a nonnegative integer. The pinned 4.1.16 interpreter approximately floors numeric count, rejects negative effective counts, and checks requested result length against its internal STRING_MAXLEN bound. Count zero produces empty text. English function names and semicolon argument separators are used here.
Reproducible examples
| Formula | Expected result |
|---|---|
=REPT("-";4) |
"----" |
=REPT("ab";3) |
"ababab" |
=REPT("x ";3) |
"x x x " |
=REPT("x";0) |
"" |
=REPT("x";2.9) |
"xx" |
=REPT("";3) |
"" |
The first formula preserves the original guide’s worked example. Its historical comparable LibreOffice 25.2 check was not an OpenOffice test. New results are independently checked reference expectations; no fresh native or GUI test is claimed. Here "" denotes zero-length text.
Practical worksheet: add a small text bar beside a count
Enter 2, 5 and 3 in A2:A4. In B2 enter =REPT("|";A2) and fill down. The expected indicators contain 2, 5 and 3 vertical bars. Keep column A numeric so sorting, totals and charting continue to use the real counts. The text bars are only a compact visual representation.
If counts can be large, show a clearly labelled scale. With values 10, 25 and 15, =REPT("|";INT(A2/5)) produces 2, 5 and 3 bars respectively. A leftover below five would not produce a full bar under this rule; state the rounding policy rather than implying exact proportional precision.
Advanced applications
Build fixed-width text padding. With text AB in A2, =A2&REPT(" ";5-LEN(A2)) produces AB followed by three ordinary spaces. Check LEN(A2)<=5 first; a longer source would create a negative count. Spaces can be hard to see, so use LEN to audit the result instead of judging by its appearance alone.
Include the separator in the repeated fragment. REPT(“x “;3) creates a trailing space as well as spaces between copies. REPT(“x”;3) gives xxx. If trailing delimiters are unwanted, construct the string with that requirement explicitly rather than assuming REPT knows where the final copy ends.
Check length. =LEN(REPT("ab";3)) returns 6. For ordinary valid counts the mathematical length is LEN(text)*count after the count’s integer conversion. This is a useful sizing check before creating a repeated label.
Errors, edge cases and troubleshooting
Negative counts are invalid; decimals such as 2.9 are floored, not rounded to the nearest whole repetition. A count of zero yields a zero-length string, not a genuinely empty worksheet cell. A formula containing that result still exists in the cell.
Legacy help in the retained snapshot mentions a 255-character limit, but the pinned interpreter actually tests its internal STRING_MAXLEN constant. This guide does not turn that old prose into a certified native boundary. Keep practical examples short, and verify the installed build’s result-size limit before using REPT to create large data. Large empty-fragment/count combinations and extreme integer conversions are outside this review.
Text bars depend on font and cell width; a proportional font or clipped display can distort appearance. REPT does not create a chart, numerical series or secure redaction. Repeating a mask character does not erase data elsewhere in a workbook. Validate input types and upstream errors before treating every displayed bar as a valid count.
Related functions
Documentation and verification
See the Apache OpenOffice REPT reference, 4.1.16 text-function help, and versioned interpreter. The official source snapshots were retrieved on October 13, 2026 and re-read for this guide; no new retrieval date is implied. Source inspection and reference calculations do not certify native encoding, locale or extreme-input behavior. First introduction and final functioning version remain unestablished; the lifecycle section identifies documented support.