Syntax. REPT(text,number_times)
Definition. This function repeats text a given number of times.
Also note the following when working with this function:
If number_times is 0, the REPT() function returns an empty string (“”).
If number_times is not an integer, the decimal places are truncated.
If number_times is a negative number, the REPT() function returns the #VALUE!
error.
If the result exceeds 32,767 characters, the REPT() function returns the #VALUE!
error.
=MAX(LEN(F6:F16)+LEN(G6:G16))+1
Press Ctrl+Shift+Enter. The array formula enclosed in braces calculates the maximal necessary length for the names and scores in each line. Enter the formula
=F6&REPT(" ",I6-LEN(F6)-LEN(G6))&G6
in cell H6 (see Figure 8-9) and copy it into the cells below H6. Based on the maximal total length and the actual total length in the row, you can calculate the necessary space.