Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Multi-criteria lookup and transpose in Excel
  • How to get address of last cell in range in Excel
  • How to get address of first cell in range in Excel
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to reference named range different sheet in Excel

Data Analysis Examples

  • How to create dynamic reference table name in Excel
  • How to create Gauge Chart in Excel
  • How to calculate average last N values in a table in Excel
  • How to count table rows in Excel
  • How To Create Frequency Distribution in Excel

Data Validation Examples

  • Excel Data validation specific characters only
  • Prevent invalid data entering in specific cells
  • Excel Data validation must begin with
  • How To Create Drop-down List in Excel
  • Excel Data validation whole percentage only

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:   Example of Count with Or Criteria 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:   If this AND that 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:   Smaller of two values in Excel

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
  • Excel MAX, MATCH and ADDRESS function illustration
  • Clean and reformat telephone numbers using SUBSTITUTE function in Excel
  • Remove unwanted characters in Excel
  • PHONETIC function: Description, Usage, Syntax, Examples and Explanation
  • How to count specific characters in a range in Excel
  • Calculate retirement date in Excel
  • Dynamic date list in Excel
  • How to calculate future date say 6 months ahead in Excel
  • Roll back weekday to Friday base on a particular date in Excel
  • How to calculate months between dates in Excel
  • DDB function: Description, Usage, Syntax, Examples and Explanation
  • COUPNCD function: Description, Usage, Syntax, Examples and Explanation
  • RRI function: Description, Usage, Syntax, Examples and Explanation
  • How to set check register balance in Excel
  • How to calculate present value of annuity in excel
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles