How to use the ASC function
What is the ASC function?
The ASC function converts full-width (double-byte) characters to half-width (single-byte) characters. This function is for double-byte character set (DBCS) languages.
What stands ASC for?
ASC is an abbreviation of ASCII which stands for American Standard Code for Information Interchange. There are 256 characters in the ASCII code set, numbered from 0 to 255. The standard characters like as letters, digits, and symbols are the same on all computers and occupy the first 128 positions 0 to 127. The remaining characters depend on the selected language and regional settings 128 to 255.
What is a byte?
A byte consists of 8 bits. A bit is an abbreviation of binary digit. A single byte is 8 bits and a double byte is 16 bits (8 + 8 = 16). A byte has 2^8 = 256 positions.
Byte - Wikipedia
What is a bit?
The binary system is a positional numeral system that uses only two digits: 0 and 1. The binary system is important in our society because many devices like computers, digital cameras, mobile phones and modern cars use binary code to store, process and communicate data. The binary numeral system makes it easy to store and transmit data using binary digits or bits.
The following table shows decimal numbers from 0 to 7 and the binary equivalent:
Decimal | Binary |
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
What are full-width double byte characters?
Full-width characters are often used for languages that have complex writing systems like Chinese, Japanese, and Korean. Single-byte characters are usually used for western languages. A double byte has 2^16 = 65 536 positions.
Why change full-width (double-byte) characters to half-width (single-byte) characters for Double-byte character set (DBCS) languages?
Some applications require converting text from half-width to full-width characters or vice versa. The ASC function can be useful for formatting or aligning text in a spreadsheet.
Excel has a related function called DBCS that converts half-width English letters or katakana within a character string to full-width characters.
DBCS function - Microsoft Support
What is DBCS?
It is an abbreviation of double-byte character set.
Table of Contents
1. ASC function Syntax
ASC(text)
The ASC function has only one argument.
2. ASC function Arguments
text | Required. Text value or a cell reference. |
3. ASC function example
The image above shows the ASC function in cell C3, the argument is a cell reference to cell B3. It converts the value in cell B3 to half-width single byte characters.
Formula in cell C3:
Cell B3 contains already a value in half-width single byte characters so no nothing is changed.
4. ASC function not working
The ASC function returns an error if the argument is an error, this scenario is shown in cells B3 and C3 respectively. The argument is #DIV/0! and the ASC function returns #DIV/0!.
The ASC function returns a #NAME! error if the function name is misspelled, this is shown in cell C4.
If text does not contain any full-width letters, text is not changed.
Useful resources
ASC function - Microsoft support
Functions in 'Text' category
The ASC function function is one of 30 functions in the 'Text' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form