Add line break based on OS in Excel
To add a line break taking into account the current OS (Mac or Windows), you can use the INFO function to test the system and then return the correct break character — CHAR(10) for Windows, CHAR(13) for Mac.
Note: make sure you have text wrap enabled on cells that contain line breaks.
The character used for line breaks is different depending on whether Excel is running on Mac or Windows: CHAR(10) for Windows, CHAR(13) for Mac. This makes it tricky to write a single formula that will work as expected on both platforms.
The solution is to use the INFO function to test the current environment, then adjust the line break character accordingly. We do this by adding this formula to C3:
Then we we name C3 “break” so we can use the word break like a variable later. If Excel is running on a Mac, break will equal CHAR(13), if not, break will equal CHAR(10).
In column E, we concatenate the address information that appears in B, C, and D with a formula like this:
The result of the concatenation is text with line breaks:
1301 Robinson Court¬
Saginaw, MI 48607