Line break in the formula

sharshra

Active Member
Joined
Mar 20, 2013
Messages
404
Office Version
  1. 365
I have a heading included as part of dynamic array. In few columns of the header, I want to introduce the line break to have the header in 2 lines. I´m trying to use CHR(10) but getting an error. Can the experts suggest please?

Desired output:
excel problems.xlsx
H
18line 1 line 2
Sheet8


Error:
excel problems.xlsx
C
17#NAME?
Sheet8
Cell Formulas
RangeFormula
C17C17=LET( a, "line 1" & chr(10) & "line 2", a)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
If you are using English version of Excel should not the function be CHAR instead of CHR?
 
Upvote 0
Good spotting! Thanks, @hagia_sofia. Now, I´m not getting the error but output is not in 2 lines. In my spreadsheet, I see them one after the other. Refer the screenshot below. But in the cell copied from my spreadsheet to here shows the lines one below the other!!! I don´t know what is happening :unsure::oops:

1730123337278.png

excel problems.xlsx
C
17line 1 line 2
Sheet8
Cell Formulas
RangeFormula
C17C17=LET( a, "line 1" & CHAR(10) & "line 2", a)
 
Upvote 0
Thanks, @MARK858. Yes, it works when wrapped. But, I thought that irrespective of wrapped or not, it should come in 2 lines since CHAR(10) is there. Is that not correct?
 
Upvote 0
No, it has always been the case that you need to wrap the cell for CHAR(10) to display as multiple lines
 
Upvote 1
Solution

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top