Contact

LEFTB in WPS Spreadsheet: Extract a Prefix with Chinese Double-Byte Counts

Text Intermediate WPS Spreadsheet

Use LEFTB in the documented WPS Chinese/Latin context, with whole-character prefix examples and clear limits on byte counting.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: under the WPS lesson’s double-byte counting convention, =LEFTB("春风AB",4) is expected to return text 春风. Each of the two Chinese characters contributes two count units.

Syntax and direction

=LEFTB(text,num_bytes)

text contains the source string. num_bytes specifies how much to take from its left edge. The examples always provide the count explicitly. The operation extracts a prefix; it neither searches for a word nor removes matching characters elsewhere in the string.

For 春风AB, the count positions are:

Character Count positions
春 1–2
风 3–4
A 5
B 6

A length of 4 ends after 风; a length of 5 also includes A. Thus the count is not simply the number of visible characters.

Complete worksheet example

  1. Enter text 春风AB in A2 on a fresh worksheet.
  2. Enter =LEFTB(A2,4) in B2. The independent expected text is 春风.
  3. Enter =LEFTB(A2,5) in C2. The independent expected text is 春风A.
  4. In A3, enter text AB春风. =LEFTB(A3,2) is expected to return AB, while =LEFTB(A3,4) returns AB春.

The changed order in A3 matters. A count of 2 can cover two Latin letters or one of the Chinese characters used here. Count the actual prefix rather than assigning one fixed number of characters to every row.

These are text results. If an extracted prefix consists only of digits, keep it as a label when leading zeros or fixed-width identifiers matter. The lesson’s numeric-looking salary example illustrates extraction; it should not be generalized into a dependable monetary truncation or rounding method.

Advanced use: extract a fixed-width category

Suppose a file layout defines a two-character Chinese category followed by an ASCII suffix. 春风AB and 秋雨CD each have a four-count category prefix under the stated convention. Applying LEFTB with count 4 extracts the category, while leaving the suffix in the source column for inspection.

That formula relies on the layout contract. If another row begins with one Chinese character and two ASCII letters, four count units would cover three visible characters instead. Validate the field layout before copying the formula to an entire column. LEFTB does not detect a malformed row or know where a business field is intended to end.

Keep the original source beside the extraction. This makes it possible to spot changed spacing, punctuation or prefixes rather than silently accepting a plausible-looking fragment.

Optional arguments and error limitations

The prose says the count must be nonnegative and describes an omitted count of one. This guide deliberately uses explicit positive lengths ending on whole characters. Its overrun bullet names LEFT rather than LEFTB, so no LEFTB overrun result is certified here from that line.

Negative counts, fractional counts, empty input, implicit numeric conversion and half-character extraction do not receive invented runtime outcomes or error codes. A formula that works on the ASCII salary example alone is not evidence for arbitrary multibyte text behavior.

Counting scope and safe boundaries

These examples use the historical lesson’s Chinese double-byte context: the ordinary Chinese characters shown count as 2, and Latin ASCII letters and digits count as 1. This is a spreadsheet counting convention for the documented context, not a universal UTF-8 byte-length rule. No result is inferred for emoji, supplementary characters, combining marks or every language/locale configuration.

All worked cuts land on complete-character boundaries. A position or length that cuts through one of the two-count Chinese characters is outside these examples; the lesson does not establish a reliable result for that case here. Do not invent a space, replacement character or partial encoded byte as the expected output.

Use the same counting system for positions and lengths. Character positions from a different function are not automatically compatible with byte-counted positions. Confirm the actual client and input convention before applying these formulas to an imported file.

Evidence and version scope

The official WPS Academy LEFTB lesson, published 2019-05-07, explicitly applies to WPS Office for Windows Personal. It was reviewed on October 18, 2026. The numeric build, introduction release and last supported version remain unknown. The source does not identify this function as deprecated or retired. Support in Linux, other editions and other platforms is not established by this lesson.

The worked examples are original mathematical expectations based on the official contract and formula illustration. They were not executed in WPS. Historical vendor demonstrations are documentation, not our application tests; no screenshot or runtime precision guarantee is supplied. English names and comma separators follow the lesson. Localized entry, workbook interchange and exact output formatting require verification in the intended client.

  • LEFT: extract by character count.
  • MID: extract a character-counted interior segment.
  • RIGHTB: extract from the other edge in the documented byte context.