Friday, 31 January 2025

CHAR

 The CHAR function in Excel returns the character specified by a numeric code. It is useful for inserting special characters, line breaks, or other non-printable characters into a cell. Below are 10 examples of how to use the CHAR function, including data and formulas.


1. Inserting a Line Break in a Cell

Use CHAR(10) to insert a line break in a cell (ensure "Wrap Text" is enabled).

Formula:

excel
Copy
="Line 1" & CHAR(10) & "Line 2"

Result:

Copy
Line 1
Line 2

2. Adding a Checkmark (✓)

Use CHAR(252) or CHAR(10004) to insert a checkmark.

Formula:

excel
Copy
=CHAR(10004)

Result:

Copy

3. Inserting a Copyright Symbol (©)

Use CHAR(169) to insert a copyright symbol.

Formula:

excel
Copy
="Copyright " & CHAR(169) & " 2023"

Result:

Copy
Copyright © 2023

4. Creating a Bulleted List

Use CHAR(149) to insert a bullet point.

Formula:

excel
Copy
=CHAR(149) & " Item 1" & CHAR(10) & CHAR(149) & " Item 2"

Result:

Copy
• Item 1
• Item 2

5. Inserting a Degree Symbol (°)

Use CHAR(176) to insert a degree symbol.

Formula:

excel
Copy
="Temperature: 25" & CHAR(176) & "C"

Result:

Copy
Temperature: 25°C

6. Adding a Double Quote (")

Use CHAR(34) to insert a double quote.

Formula:

excel
Copy
="She said, " & CHAR(34) & "Hello!" & CHAR(34)

Result:

Copy
She said, "Hello!"

7. Inserting a Non-Breaking Space

Use CHAR(160) to insert a non-breaking space.

Formula:

excel
Copy
="First" & CHAR(160) & "Last"

Result:

Copy
First Last

8. Creating a Star Rating System

Use CHAR(9733) for a filled star and CHAR(9734) for an empty star.

Formula:

excel
Copy
=REPT(CHAR(9733), 3) & REPT(CHAR(9734), 2)

Result:

Copy
★★★☆☆

9. Inserting a Tab Character

Use CHAR(9) to insert a tab character.

Formula:

excel
Copy
="Column1" & CHAR(9) & "Column2"

Result:

Copy
Column1    Column2

10. Combining CHAR with Other Functions

Use CHAR with CONCATENATE or TEXTJOIN to create dynamic strings.

Formula:

excel
Copy
=TEXTJOIN(CHAR(10), TRUE, "Name: John", "Age: 30", "City: New York")

Result:

Copy
Name: John
Age: 30
City: New York

CHAR Code Reference Table

CharacterCHAR Code
Line Break10
Tab9
Copyright Symbol169
Degree Symbol176
Checkmark10004
Bullet Point149
Double Quote34
Non-Breaking Space160
Filled Star9733
Empty Star9734

These examples demonstrate the versatility of the CHAR function in Excel. You can combine it with other functions to create dynamic and visually appealing spreadsheets.

No comments:

Post a Comment