Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Conditional Formatting New Rule with Formulas in Excel
  • How To Create Pareto Chart in Excel
  • Subtotal function in Excel
  • Conflicting Multiple Conditional Formatting Rules in Excel
  • Add Outline to Data in Excel

References

  • Offset in Excel
  • How to get last row in mixed data with blanks in Excel
  • How to get first column number in range in Excel
  • Excel Advanced Lookup using Index and Match Functions
  • Two-way lookup with VLOOKUP in Excel

Data Validations

  • Excel Data validation don’t exceed total
  • Excel Data validation must begin with
  • Excel Data validation must not contain
  • Excel Data validation with conditional list
  • Excel Data validation no punctuation

Add line break based on OS in Excel

by

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.

Worked Example:   If cell is not blank in Excel

Formula

=IF(INFO("system")="mac",CHAR(13),CHAR(10))

Explanation

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:

=IF(INFO("system")="mac",CHAR(13),CHAR(10))

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).

Worked Example:   How to create Checklist in Excel

In column E, we concatenate the address information that appears in B, C, and D with a formula like this:

=B6&break&C6&break&D6

The result of the concatenation is text with line breaks:

Worked Example:   How to count line breaks in cell in Excel worksheet

Traci Brown¬
1301 Robinson Court¬
Saginaw, MI 48607

 

Post navigation

Previous Post:

How to add a line break with a formula while joining text strings in Excel

Next Post:

How to Capitalize first letter in a sentence in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • Invoice status with nested if in Excel
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • XOR function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel
  • IF, AND, OR and NOT Functions Examples in Excel

Date Time

  • Convert text timestamp into time in Excel
  • Convert decimal hours to Excel time
  • DAY function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate project start date based on end date in Excel
  • TODAY function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Calculate conditional mode with criteria in Excel
  • Categorize text with keywords in Excel
  • If cell contains one of many things in Excel
  • Group numbers with VLOOKUP in Excel
  • Running count group by n size in Excel

General

  • How to generate random date between two dates in Excel
  • How to Delete Cells, Row and Rows in Excel
  • How to calculate percent of goal in Excel
  • How to add sequential row numbers to a set of data in Excel
  • How to calculate percent of students absent in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning