LEFT(), LEFTB()

Syntax

  • LEFT(text,num_chars)

  • LEFTB(text,num_bytes)

Definition. The LEFT() function returns the first characters of a string. The LEFTB() function is used for double-byte characters and returns the first bytes.

Arguments

  • text (required). The string containing the characters you want to extract

  • num_chars/num_bytes (optional). Specifies how many characters to extract

Background. Use the LEFT() function to extract the first part of a string. You can enter letters or numbers in the text argument. The functions LEFT(), RIGHT(), and MID() are especially useful if strings have a particular pattern, as in the case with ZIP Codes, locations, or ISBNs.

The num_chars argument has to be greater than or equal to 0. If the value of num_chars is greater ...

Get Microsoft® Excel® 2010 Formulas & Functions Inside Out now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.