Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this simple formula:

=CONCATENATE("foo";"bar")

which renders foobar on the cell.

How can I lay this formula in multiple lines in the same cell? I'd like to be able to do something like the following but it doesn't work as the newline in the cell forbids the formula from being executed:

=CONCATENATE("foo";
             "bar")

The reason I'm asking is because I have huge formulas an I need to format them (using newlines and a bit of indentation) for readability.

thanks

share|improve this question

2 Answers 2

To insert a line break in the formula's result, this should work:

=CONCATENATE("foo";CHAR(10);"bar")

A structured overview over the current formula is provided by the function wizard (Ctrl+F2); it should directly display the Structure tab if the current cell already holds a formula.

share|improve this answer
    
Thanks but I don't want to output a newline as a result of the expression. I want to split my long expression with newline(s) for enhancing readability. –  cherouvim Jun 28 '11 at 8:17
    
@cherouvim: oh, sorry, i see. Then, there's only the function wizard i can offer. I've amended my previous answer accordingly. –  tohuwawohu Jun 28 '11 at 10:36

I tried to do this with LibreOffice Calc, v3.5.4.2 (!), and while I was able to enter (via CTRL-ENTER) multiple carriage-returns while editing the formula, once I pressed enter, it collapsed them into spaces.

You COULD edit your formulae in another editor, using the line breaks as desired, then copy & paste this into a cell. But that's still not optimal.

alas, there seems no hope. At least not today.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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