Left() function



The Microsoft Excel LEFT function allows you to extract a substring from a string, starting from the left-most character.

Syntax

The syntax for the LEFT function in Microsoft Excel is:
LEFT( text, [num_chars] )

Parameters or Arguments

text

The string that you wish to extract from.

num_chars

Optional. It indicates the number of characters that you wish to extract starting from the left-most character. If this parameter is omitted, only 1 character is returned.

Usage notes

·         Use the LEFT function when you want to extract characters starting at the left side of text.
·         num_chars is optional and defaults to 1.
·         LEFT will extract digits from numbers as well.
·         Number formatting (i.e. the currency symbol $) is not part of a number so is not counted or extracted.

Left Function Examples

Column B of the following spreadsheet shows three examples of the Excel Left function.

 Formulas:


A
B
1
Original Text
=LEFT( A1 )
2
Original Text
=LEFT( A2, 4 )
3
Original Text
=LEFT( A3, FIND( " ", A3 ) - 1 )

 Results:


A
B
1
Original Text
O
2
Original Text
Orig
3
Original Text
Original

Note that in the above examples:

-          The function in cell B1 omits the [num_chars] argument and so in this case, [num_chars] is set to the default value 1.
-          In cell B3, the Excel Find Function is used to find the position of the first space in the text string "Original Text". This result is then provided to the Left function, to split the original text string at the first space.

Reference:

like us on https://www.facebook.com/Arivilm2501/

No comments:

Post a Comment

OR Function