Inserting a New Line (Carridge Return) In a Formula

Discuss the spreadsheet application
Post Reply
dannydont
Posts: 10
Joined: Tue Apr 08, 2008 9:18 pm

Inserting a New Line (Carridge Return) In a Formula

Post 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
dannydont
Posts: 10
Joined: Tue Apr 08, 2008 9:18 pm

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

Post 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.
User avatar
Villeroy
Volunteer
Posts: 31363
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Post by Villeroy »

Calc formulas can not read nor write newline characters.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dannydont
Posts: 10
Joined: Tue Apr 08, 2008 9:18 pm

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

Post 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
User avatar
Villeroy
Volunteer
Posts: 31363
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

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

Post by huw »

Issue 83666 is part of the problem.
Post Reply