Forum Discussion
REPT problem
LEN(A28) and REPT("=",A3) are both working correctly. LEN counts the 32 characters in the text, including spaces, and REPT returns exactly 32 equals signs. The apparent difference is visual, not a formula-length difference: Excel normally uses a proportional font, so each character has its own width. Uppercase letters, lowercase letters, spaces, parentheses, and the equals-sign glyph do not occupy equal horizontal space, even when the character counts match. You can verify this with =LEN(A4), which should also return 32. If you need a text ruler whose repeated characters line up predictably, apply the same monospaced font, such as Consolas or Courier New, to both cells. If the goal is to underline or separate the label, do not build the line with REPT; apply a bottom border to the cell or range instead. A border remains aligned when the column width, zoom, font, or displayed text changes.