Text functions
ASC
Matches all 14 recorded answers
Recorded: 14 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
Every language in the source keeps the English name.
| Language | Name in Excel |
|---|---|
| Arabic | ASC |
| Bulgarian | ASC |
| Czech | ASC |
| Danish | ASC |
| German | ASC |
| Greek | ASC |
| English (Australia) | ASC |
| English (United Kingdom) | ASC |
| English (United States) | ASC |
| Spanish | ASC |
| Estonian | ASC |
| Finnish | ASC |
| French | ASC |
| Hebrew | ASC |
| Croatian | ASC |
| Hungarian | ASC |
| Indonesian | ASC |
| Italian | ASC |
| Japanese | ASC |
| Korean | ASC |
| Lithuanian | ASC |
| Latvian | ASC |
| Norwegian | ASC |
| Dutch | ASC |
| Polish | ASC |
| Portuguese (Brazil) | ASC |
| Portuguese (Portugal) | ASC |
| Romanian | ASC |
| Russian | ASC |
| Slovak | ASC |
| Slovenian | ASC |
| Serbian (Latin) | ASC |
| Swedish | ASC |
| Thai | ASC |
| Turkish | ASC |
| Ukrainian | ASC |
| Vietnamese | ASC |
| Chinese (Simplified) | ASC |
| Chinese (Hong Kong) | ASC |
| Chinese (Traditional) | ASC |
Names from Microsoft's support site.
What it does
ASC(text)
ASC converts full-width (double-byte) characters in a string to their half-width (single-byte)
equivalents.
The concepts come from East Asian text handling and predate Unicode. In the legacy double-byte
character sets used for Japanese, Korean and Chinese text, Latin letters, digits and katakana each
existed in two forms: a half-width form occupying one byte and one display column, and a
full-width form occupying two bytes and two display columns. Unicode preserved both, so the
distinction survives as separate code points — A (U+0041) versus A (U+FF21), ア (U+FF71)
versus ア (U+30A2). ASC maps the wide forms down to the narrow ones. The mapping is not a
rounding or an approximation; it is a table.
Two details make the katakana half of the mapping harder than the Latin half:
- Voiced katakana are one character wide and two characters narrow. Full-width
ガis a single code point; its half-width form is the pairカ+゙(a base kana and a combining-style voiced sound mark). SoASCcan lengthen a string, and a naive one-to-one mapping table is wrong. - Not everything has a half-width form. Hiragana, kanji, and most full-width punctuation outside the ASCII-mirror block have no narrow counterpart and pass through untouched.
Now the part that matters most for this entry, and which is easy to get wrong by reading only the
concept: whether ASC converts anything at all depends on the host environment. The function is
part of the East Asian compatibility surface, and its behaviour is tied to the language settings of
the Excel installation rather than being a fixed text transformation.
So the operational definition of ASC is two-stage: ask the environment whether width conversion
is active for this function; if it is, apply the full-width-to-half-width table; if it is not,
return the text unchanged. That is a genuinely unusual shape for a worksheet function, and it is
the reason this page is careful.
Arguments
ASC(text)
| Argument | Required | Meaning |
|---|---|---|
text | yes | The text containing characters to narrow. |
One argument, no options — no way to ask for only the Latin part, only the katakana part, or a specific mapping table. Non-text arguments convert to text by the ordinary rules in coercion and lifting.
Try it
Quirks
Result and edge cases
The return kind is Text.
- Characters with no half-width form pass through, so
ASCapplied to hiragana or kanji is the identity. - The result can be longer than the input in UTF-16 code units, because of the voiced-katakana
decomposition described above. Any assumption that
LEN(ASC(x)) <= LEN(x)is false in general — it is false in exactly the case the function exists for. - On a host where width conversion is not active,
ASCis the identity function on all input. This is the case the upstream replay observed. A workbook that relies onASCtherefore computes different values on different machines, which makes it unsuitable for anything auditable without pinning the environment. - Errors propagate, and an empty referenced cell delivers
Emptyrather than a missing argument; see the value universe.
Errors
Microsoft's page is the authority and is linked below; it was not retrievable while this entry was written, so this section states expectations rather than quoting it.
#NAME? for an existing function is jarring, and worth explaining: it is the worksheet's answer
when a name is not recognised in the current environment, which is what a compatibility function
looks like on a host that does not admit it.
How to implement
Notes for implementers
- Do not implement this as a local text function without a host query. The upstream design — ask the host for the mode, then apply the transformation — is the shape that matches observed behaviour. A port that always narrows will disagree with Excel on every host where conversion is inactive, which upstream observed to include a real one.
- The mapping table must handle the voiced katakana decomposition, which is one-to-two. Build it
as a table, not as an arithmetic offset, even though the Latin block is tantalisingly regular
(
U+FF01–U+FF5Emaps toU+0021–U+007Eby subtracting0xFEE0). - The full-width space
U+3000maps to the ordinary spaceU+0020, which interacts withTRIM: narrowing first can change what a laterTRIMremoves. - Work in UTF-16 code units and be prepared for the output to be longer.
- Record the host profile in any test fixture. A width-conversion test with no environment recorded is not reproducible, and is arguably not evidence at all.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
ASC · 1 lines · calc-func/src/catalogue/text_format.rs on GitHub9 asc_fn "ASC" (1, 1) [V "text"] |s, a, sv| { width_conversion(s, a) }
Kernels shared with other functions
profilecatalogue/text_formatwidth_conversioncatalogue/text_format
Argument and result plumbing
text_argcatalogue/kit
No implementation has been published with a Handbook test suite for this function.
Version differences
No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.
Alternatives
Relationships
DBCS— the exact inverse direction: half-width to full-width. Same host dependency, same module upstream.LENversusLENB— the width distinction shows up again in the byte-counting functions, and the*Bfamily (LEFTB,MIDB,FINDB, …) exists for the same East Asian reasons. Upstream records those as current-baseline delegates to their non-Bcounterparts rather than as independent byte-semantic implementations.UPPERandLOWER— case conversion, frequently confused with width conversion because both "change the letters". They are independent axes:Aandadiffer in case,AandAdiffer in width.- Unicode's own NFKC normalisation performs a superset of
ASC's Latin mapping. It is not a substitute — NFKC also folds ligatures, superscripts and much else.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents