LENB: Double-Byte Text Length in WPS Spreadsheet
Measure text with LENB under the official Chinese double-byte convention, with ASCII, ordinary Chinese, punctuation and space examples plus locale limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
LENB measures text using the double-byte counting convention described by the Chinese WPS lesson. In that context, ordinary Chinese characters and fullwidth punctuation count as two, while ASCII letters, digits, halfwidth punctuation and spaces count as one. This is a compatibility length measure, not a universal measurement of a saved file’s encoding.
Syntax and locale context
=LENB(text)
The required argument is the text to measure, or a reference containing it. Spaces count. The lesson explicitly contrasts LENB’s byte-style count with a character count. The controls here stay within ordinary Chinese text, ASCII and the displayed punctuation classes.
Do not generalize this convention to UTF-8 byte length, Unicode code-point count, grapheme clusters, emoji or supplementary characters. The lesson does not establish cross-locale parity or how every script is classified. Its Windows Personal label is not proof that all regional settings produce identical results.
Exact text controls
The spaces between quotation marks are intentional. Enter each string literally; do not trim the last example before evaluating it.
| Formula | Independently expected result |
|---|---|
=LENB("ABC") |
3 |
=LENB("ä¸å›½") |
4 |
=LENB("Aä¸1") |
4 |
=LENB("ä¸ æ–‡") |
5 |
=LENB(",,") |
3 |
=LENB(" A ") |
3 |
For Aä¸1, A contributes one, ä¸ contributes two and 1 contributes one, totaling four. In ä¸ æ–‡, the Chinese characters contribute four together and the single intervening space contributes one, totaling five. The punctuation example contains a fullwidth Chinese comma followed by an ASCII comma, so its lesson-context count is 2+1=3.
Worksheet setup and practical use
Place the text Aä¸1 in A2 and enter =LENB(A2) in B2. The independently expected count under the lesson’s convention is four. This is a useful check when maintaining a legacy text-width rule that explicitly uses that same convention.
For a hypothetical field budget of six such units, Aä¸1 uses four and leaves two units. Adding one ordinary Chinese character would use those two units; adding one ASCII character would use one. This is arithmetic under the stated convention, not a guarantee that an external database or network protocol uses the same storage width. Confirm the receiving system’s definition before using this measure as an upload or storage limit.
Common mistakes
A visually wide glyph is not enough to infer its byte classification. Font width, worksheet column width and LENB’s counting rule are different things. Likewise, counting Chinese text as two units does not mean its UTF-8 encoding takes two bytes.
Spaces at either end can change the count even when they are hard to notice. Keep an untouched copy of the source string when investigating a discrepancy, rather than silently cleaning it and comparing a different value. The lesson states that spaces count but does not specify every control character or line-ending convention.
Errors and unsupported inputs
The cited lesson does not enumerate exact errors for missing arguments, invalid references or non-text coercion. Use explicit text or a text cell for the demonstrated contract. Emoji, combining marks, unusual fullwidth forms and locale-dependent character classifications need separate target evidence. No native parser or encoding test has been performed for this guide.
Availability and evidence
The official WPS lesson is dated 2019-05-28 and explicitly labels its applicability WPS Office for Windows Personal. It does not identify a numeric release. This establishes documentation by that date, not the function’s original introduction or its last working version. Current build limits and equivalence across WPS clients remain unverified. The available evidence does not establish retirement or formal deprecation.
Checked October 18, 2026. The examples in this guide are original, independently calculated controls based on the lesson. They have not been run in WPS or another spreadsheet application. No screenshot or execution result is claimed.