Is there some kind of string templating system in Excel or OpenOffice/LibreOffice Calc? Basically I have a text template that references some other cells and want to produce the final merged result, e.g.:
My name is [A1].
I have been working at [A2] for [A3] years.
Welcome to you all.
(The template variables need not be cell references directly; it can be function parameters so formula copying is not a pain.)
I know about string concatenation, but it doesn't seem to support multi-line string nor C-style escape sequence like "\n", requiring me to chain CHAR(10) which becomes unwieldy:
="My name is "& A1 & CHAR(10) &
"I have been working at " & A2 & " for " & A3 & " years." & CHAR(10) &
"Welcome to you all."
Actually, you are allowed to insert line breaks in a string (Alt+Enter)
Try this formula and don't forget to activate Wrap text for the cell.
="My name is "& A1 & "
I have been working at " & A2 & " for " & A3 & " years.
Welcome to you all."

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With