Page 1 of 1

Inserting a New Line (Carridge Return) In a Formula

Posted: Tue Apr 08, 2008 9:35 pm
by dannydont
I have brought an existing, functioning spreadsheet from MS Excel (where it works just fine) to OO Calc. Everything is working as before except perhaps the most important feature and that is the ability to add a CR (or NL) to the formula and have it recognized. I used the CHAR(10) special character in Excel and have tried the same thing in Calc with no success. PROCESS: I build several "intermediate" strings of information in a worksheet called Formulas. These formulas pull information from a worksheet called RawData. Then I try to combine everything that is built within the Formulas worksheet into a final document in a worksheet called Directory. I am creating a multi-line Phone/Address Book from RawData. In the final document in the Directory worksheet, I have Last Name on one line, then have Male First Name (if there is one) and/or Female First Name (if there is one) but all in the same cell!! This is one place where I would Insert the CHAR(10) into the formula. This continues through a number of variable" conditions. I hope that I have described this well enough. I think if one can just show me how to Concatenate two fields with a CR (or NL) - CHAR(10) between the two fields so that when the data is finally displayed, the First Field (cell) is in the same cell as the Second Field (cell) but one above the other. Make sense?
I thank you for any guidance you might provide,
Dan

Re: Inserting a New Line (Carridge Return) In a Formula

Posted: Tue Apr 08, 2008 9:38 pm
by dannydont
I sort of messed up my explanation. In one Cell I have the Last Name and within the same cell but below Last Name I have a Male First Name and/or a Female First Name.
Sorry if I confused the issue.

Re: Inserting a New Line (Carridge Return) In a Formula

Posted: Tue Apr 08, 2008 10:21 pm
by Villeroy
Calc formulas can not read nor write newline characters.

Re: Inserting a New Line (Carridge Return) In a Formula

Posted: Tue Apr 08, 2008 11:44 pm
by dannydont
So does that mean that I am just out of luck or is there some trick or something in Basic that I can code? There probably is a good reason for this but in my case it is rather a short coming. But, thanks for your reply. At least I can set down my "hammer" and stop trying to make it happen!
Dan

Re: Inserting a New Line (Carridge Return) In a Formula

Posted: Wed Apr 09, 2008 12:20 am
by Villeroy
Indeed, I believe trying to work around this design flaw is pointless. Line feeds are not part of any formula result. Having line feeds in constant string values the cell is turned into a special cell of formatted text just like a text with partial character formatting or hyperlink-fields. A formula can not return the line feed as it can not return partial formatting of text portions.

Re: Inserting a New Line (Carridge Return) In a Formula

Posted: Wed Apr 09, 2008 9:55 am
by huw
Issue 83666 is part of the problem.