This Excel tutorial explains how to use the Excel LEFT function with syntax and examples.
The Microsoft Excel LEFT function allows you to extract a substring from a string, starting from the left-most character.
The syntax for the LEFT function in Microsoft Excel is:
LEFT( text, [number_of_characters] )
The LEFT function can be used in the following versions of Microsoft Excel:
The LEFT function can be used in Microsoft Excel as the following type of function:
Let's look at some Excel LEFT function examples and explore how to use the LEFT function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following LEFT examples would return:
=LEFT(A1, 5) Result: "Alpha" =LEFT(A2, 8) Result: "techonth" =LEFT("Excel", 2) Result: "Ex" =LEFT("Excel") Result: "E" =LEFT("Excel", 25) Result: "Excel"
The LEFT function can also be used in VBA code in Microsoft Excel.
Let's look at some Excel LEFT function examples and explore how to use the LEFT function in Excel VBA code:
Dim LResult As String LResult = Left("Alphabet",3)
The variable LResult would now contain the value of "Alp".
(scroll to see more)