Forum Discussion
REPT problem
Hi, yes, your explanation is correct. LEN(A28) counts exactly 32 characters, including spaces, and REPT("=",A3) therefore also produces exactly 32 = characters. So there is no problem with either formula.
The reason the result in A4 appears longer is the proportional font: the individual characters do not all have the same visual width. The = character is wider than some of the letters and spaces in A28.
As a quick verification, =LEN(A4) should also return 32. If you change both cells to a monospaced font such as Consolas or Courier New, the two strings will have the same visual width.
As an alternative, if the intention is simply to create a separator or underline below A28, I would recommend using an Excel bottom border instead of REPT. That will remain correctly aligned even if the text, font, zoom level, or column width changes.
So the formulas are working correctly; the difference is only in how Excel displays the characters.
My answers are voluntary and without guarantee!
Hope this will help you.