LEFT Function
Purpose
Returns the first character or characters in a text string, based on the number of characters you specify.
Syntax
EXCEL
=LEFT(text, [num_chars])
Arguments Breakdown
| Argument | Required? | Description |
|---|---|---|
text |
Required | The text string that contains the characters you want to extract. |
num_chars |
Optional | The number of characters to extract from the left side (defaults to 1 if omitted). |
Practical Examples
1. Extract Leading Initials Drill
From Formulas_&_Functions_Part_1.xlsx:
If A1 contains "Mostafa ":
EXCEL
=LEFT(A1, 3)
Result: "Mos".
2. Extract Category Prefix from SKU
In Superstore dataset: Order ID = "CA-2016-152156"
EXCEL
=LEFT([@[Order ID]], 2)
Result: "CA".
3. Dynamic First Name Extraction
EXCEL
=LEFT(A2, SEARCH(" ", A2) - 1)
Behavior Rules
num_charsmust be $\ge 0$. If negative, returns#VALUE!.- If
num_charsis greater thanLEN(text),LEFTreturns the entire string.
Related Knowledge
- Notes: 05 Text Manipulation Functions
- Workbook:
11_Demos_and_Workbooks/03_Formulas_and_Functions/Formulas_&_Functions_Part_1.xlsx(Sheet:Text)