0

I currently have a spreadsheet which requires a variable number of line breaks within a cell based on input data from another cell.

Long story short, I currently am using a brute force method to accomplish this, via a lengthy IFS() statement where each condition has one more instance of "CHAR(10)" than the previous.

My function as is, which is an IFS() function

It gets the job done, but it's very bloated. I might be taking a wild shot in the dark here, but is there any function (or series of functions) that adds x number of y character to a cell? Or would I have to create something myself via custom function or apps script?

Thank you!

1

1 Answer 1

1

See rept():

Syntax

REPT(text_to_repeat, number_of_repetitions)

text_to_repeat - The character or string to repeat.

number_of_repetitions - The number of times text_to_repeat should appear in the value returned.

The number_of_repetitions can’t exceed the character limit of a cell, 32,000 characters. If number_of_repetitions is greater than 32,000 characters, REPT will return a #VALUE! error.

Not the answer you're looking for? Browse other questions tagged or ask your own question.