There are 2 ways to insert it, depending on the purpose.
What are they? Let's see:
1. Manually pressing ALT + ENTER:
One way to insert the line break is to insert it manually using the ALT + Enter keys. To do this we need to be in the cell where you want to insert it, and press ALT + ENTER before the text where you want to insert the line break . In my example above we can see that the line break is placed after 'a' and after 'break', and it was achieved by pressing ALT + Enter right after both words. Sometimes we do this action, Excel wraps the text automatically but sometimes the text do not flow nicely and it is necessary to adjust the column/row width.
2. With the CHAR function and Wrap text option:
This method is great if you are working with (or without) formulas. Nothing manual. Let's see how it works.
The CHAR function returns the number corresponding to a specified character. For example, =CHAR(49)=1, =CHAR(77)=M.
But the important thing here is that =CHAR(10) is the line break. With this in mind it is easy to enter this formula in another formula with the CONCATENATE function or with the & operator.
Imagine you have in cell A1 the text 'Total' and A2 the number 9, which could clearly be the result of any formula in that cell. Now in cell B1 we could enter the following formula:
=A1&CHAR(10)&A2="Total9"
The visual result of this formula seems that is not the result we want, but it is before we are missing one final thing. We now need to apply the Wrap Text option to achieve the desired result.
And the result would look like this:
A bit of formatting would help to make it look nicer.
No comments:
Post a Comment