Basic functions: REPT

The REPT function can be used to create simple charts without the use of the OOo Calc charting tool - although it is not clear if that was the original intent of the function.



REPT is a text function that repeats a specified string or character a specified number of times.

In the example below, char(10)is a special character that appears as a square symbol in most fonts. The resulting effect is that of a bar-chart in column C based on the corresponding number in column B.

rept1.jpg

Taking the idea behind the above example a bit further, we get a bit more elaborate in the spreadsheet below - with some “charts” based on the sine function.

In column A we have

&nbsp&nbsp&nbsp&nbsp=REPT(CHAR(10);INT((SIN(ROW()/8)+1)*25))

and in column B, we have

&nbsp&nbsp&nbsp&nbsp=CONCATENATE(REPT(” “;INT((SIN(ROW()/8)+1)*25));”*”)

rept2.jpg

Leave a Reply