Subscribe for New Post Notifications

Techworld

How to use the CHAR function in Microsoft Excel

Let's look at some Excel Char function examples and explore how to use the Char function as a worksheet function in Microsoft Excel:

CHAR function

Summary

The CHAR function is the inverse of the CODE function. CHAR Function in Excel is a function that returns the character specified by the code number (ASCII code) from the character set for your computer.
CHAR can be used to specify characters that are hard to enter in a formula. For example, CHAR(10) returns a line break on Windows, and CHAR(13) returns a line break on the Mac.
The Char function is a built-in function in Excel that is categorized as a Text Function.

Purpose

Get a character from a number

Return value

A single character specified by a number.

What Does It Do ?

This function converts a normal number to the character it represent in the ANSI character set used by Windows.

Syntax

CHAR function has one syntax and hence they can be written in Two different ways:

=CHAR(number) or
=CHAR(cell reference)

Parameters or Arguments

Number - A number between 1 and 255.
Cell reference: Reference to cells containing number.

Formatting

The result will be a character with no special formatting.

Usage notes

  • Use CHAR to translate code page numbers into actual characters.
  • CHAR can be useful when you want to specify characters in formulas or functions that are awkward or impossible to type directly. For example, you can use CHAR(10) to add a line break in a formula on Windows, and CHAR(13) to add a line break on the Mac.
  • The character set may vary across different operating systems and so, for a specific number, the function may return different results on different computers. Windows OS uses the ANSI character set, whereas Macintosh uses the Macintosh character set.
  • We get VALUE# error – It occurs when: The given argument is not an integer between 1 to 255 and If the argument entered is zero.
  • Excel functions CHAR and UNICHAR will return the character for a given code whereas Excel functions CODE and UNICODE would do the opposite – give the code for a given character.
  • For numbers greater than 255, we can use the UNICHAR function.

What is ASCII code?

ASCII stands for American Standard Code For Information Interchange, is a character encoding standard for the digital communications. For each character that can be typed, has a unique integer number associated with it, may it be a character set, digits, punctuation marks, special characters, or control characters. For example, the ASCII value for [space] is 032. ASCII values ranging from 097-122 are reserved for the alphabets a-z in lower case.

You can Download a list of all 255 numbers and the characters they represent.
CHAR function

No comments:

Post a Comment