Excel LEFT function with formula examples (2024)

The tutorial shows how to use the LEFT function in Excel to get a substring from the beginning of the text string, extract text before a certain character, force a Left formula to return a number, and more.

Among many different functions that Microsoft Excel provides for manipulating text data, LEFT is one of the most widely used. As its name suggests, the function allows you to extract a certain number of characters starting at the left side of a text string. However, Excel LEFT is capable of much more than its pure essence. In this tutorial, you will find a couple of basic Left formulas to understand the syntax, and then I will show you a few ways in which you can take the Excel LEFT function well beyond its basic usage.

Excel LEFT function - syntax

The LEFT function in Excel returns the specified number of characters (substring) from the start of a string.

The syntax of the LEFT function is as follows:

LEFT(text, [num_chars])

Where:

  • Text (required) is the text string from which you want to extract a substring. Usually it is supplied as a reference to the cell containing the text.
  • Num_chars (optional) - the number of characters to extract, starting on the left side of the string.
    • If num_chars is omitted, it defaults to 1, meaning that a Left formula will return 1 character.
    • If num_chars is greater than the total length of text, a Left formula will return all of text.

For example, to extract the first 3 characters from the text in cell A2, use this formula:

=LEFT(A2, 3)

The following screenshot shows the result:Excel LEFT function with formula examples (1)

Important note! LEFT belongs to the category of Text functions, therefore the result of a Left formula is always a text string, even if the original value from which you extract characters is a number. If you are working with a numeric dataset and want the LEFT function to return a number, use it in conjunction with the VALUE function as demonstrated in this example.

How to use LEFT function in Excel - formula examples

Apart from extracting text from the left of a string, what else can the LEFT function do? The following examples show how you can use LEFT in combination with other Excel functions to solve more complex tasks.

How to extract a substring before a certain character

In some cases, you may need to extract the part of the text string that precedes a specific character. For example, you may want to pull the first names from a column of full names or get the country codes from a column of phone numbers. The problem is that each name and each code contains a different number of characters, and therefore you cannot simply supply a predefined number to the num_chars argument of your Left formula like we did in the above example.

If the first and last names are separated by a space, the problem boils down to working out the position of the space character in a string, which can be easily done by using either SEARCH or FIND function.

Supposing the full name is in cell A2, the position of the space is returned by this simple formula: SEARCH(" ",A2)). And now, you embed this formula in the num_chars argument of the LEFT function:

=LEFT(A2, SEARCH(" ", A2))

To improve the formula a bit further, get rid of the trailing space by subtracting 1 from the Search formula result (not visible in cells, trailing spaces may cause many problems especially if you plan to use the extracted names in other formulas):

=LEFT(A2, SEARCH(" ", A2)-1)Excel LEFT function with formula examples (2)

In the same fashion, you can extract the country codes from a column of telephone numbers. The only difference is that you use the Search function to find out the position of the first hyphen ("-") rather than a space:

=LEFT(A2, SEARCH("-", A2)-1)Excel LEFT function with formula examples (3)

Wrapping up, you can use this generic formula to get a substring that precedes any other character:

LEFT(string, SEARCH(character, string) - 1)

How to remove the last N characters from a string

You already know how to use the Excel LEFT function to get a substring from the start of a text string. But sometimes you may want to do something different - remove a certain number of characters from the end of the string and pull the rest of the string into another cell. For this, use the LEFT function in combination with LEN, like this:

LEFT(string, LEN(string) - number_of_chars_to_remove)

The formula works with this logic: the LEN function gets the total number of characters in a string, then you subtract the number of unwanted characters from the total length, and have the LEFT function return the remaining characters.

For example, to remove the last 7 characters from text in A2, use this formula:

=LEFT(A2, LEN(A2)-7)

As shown in the screenshot below, the formula successfully cuts off the " - ToDo" postfix (4 letters, a hyphen and 2 spaces) from the text strings in column A.Excel LEFT function with formula examples (4)

How to force the LEFT function to return a number

As you already know, the Excel LEFT function always returns text, even when you are pulling a few first digits from a number. What it means to you is that you won't be able to use the results of your Left formulas in calculations or in other Excel functions that operate on numbers.

So, how do you make Excel LEFT to output a number rather than a text string? Simply by wrapping it in the VALUE function, which is designed to convert a string representing a number to a number, like this: VALUE(LEFT())

For example, to extract the first 2 characters from the string in A2 and convert the output into numbers, use this formula:

=VALUE(LEFT(A2,2))

The result will look something similar to this:Excel LEFT function with formula examples (5)

As you can see in the screenshot above, the numbers in column B obtained with a Value Left formula are right-alighted in cells, as opposed to left-aligned text in column A. Since Excel recognizes the output as numbers, you are free to sum and average those values, find the min and max value, and perform any other calculations.

These are just a few of many possible uses of LEFT in Excel. To have a closer look at the formulas discussed in this tutorial, you are welcome to download the Excel LEFT function sample worksheet.

For more Left formula examples, please check out the following resources:

  • Split string by comma, colon, slash, dash or other delimiter
  • How to split string by line break
  • How to convert 8-number to date
  • Count the number of characters before or after a given character
  • Array formula to perform different calculations on numbers within different ranges

Excel LEFT function not working - reasons and solutions

If the Excel LEFT function does not work properly in your worksheets, it's most likely because of one of the following reasons.

1. Num_chars argument is less than zero

If your Excel Left formula returns the #VALUE! error, the first thing for you to check is the value in the num_chars argument. If it's a negative number, just remove the minus sign and the error will be gone (of course, it's very unlikely that someone will put a negative number there of purpose, but to err is human :)

Most often, the VALUE error occurs when the num_chars argument is represented by another function. In this case, copy that function to another cell or select it in the formula bar and press F9 to see what it equates to. If the value is less than 0, then check the function for errors.

To better illustrate the point, let's take the Left formula we've used in the first example to extract the country phone codes: LEFT(A2, SEARCH("-", A2)-1). As you may remember, the Search function in the num_chars argument calculates the position of the first hyphen in the original string, from which we subtract 1 to remove the hyphen from the final result. If I accidentally replace -1, say, with -11, the formula would through the #VALUE error because the num_chars argument equates to a negative numbers:Excel LEFT function with formula examples (6)

2. Leading spaces in the original text

In case your Excel Left formula fails for no obvious reason, check the original values for leading spaces. If you have copied your data from the web or exported from another external source, many such spaces may lurk unnoticed before the text entries, and you will never know they are there until something goes wrong. The following image illustrates the problem:Excel LEFT function with formula examples (7)

To get rid of the leading spaces in your worksheets, use the Excel TRIM function or the Trim spaces tool.

3. Excel LEFT does not work with dates

If you attempt use the Excel LEFT function to get an individual part of a date (such as day, month or year), in most cases you will only retrieve the first few digits of the number that represents that date. The point is that in Microsoft Excel, all dates are stored as integers representing the number of days since January 1, 1900, which is stored as number 1 (for more information, please see Excel date format). What you see in a cell is just a visual representation of the date and its display can easily be changed by applying a different date format.

For example, if you have the date 11-Jan-2017 in cell A1 and you try to extract the day by using the formula LEFT(A1,2), the result would be 42, which is the first 2 digits of number 42746 that represents January 11, 2017 in the internal Excel system.

To extract a specific part of a date, use one of the following functions: DAY, MONTH or YEAR.

In case your dates are entered as text strings, the LEFT function will work without a hitch, as shown in the right part of the screenshot:Excel LEFT function with formula examples (8)

This is how you use the LEFT function in Excel. I thank you for reading and hope to see you again next week.

You may also be interested in

  • Excel substring: how to extract text from cell
  • How to use the TEXT function in Excel
  • How to use RIGHT function in Excel
  • Excel MID function - basic uses and advanced formula examples
Excel LEFT function with formula examples (2024)

FAQs

How to use Excel left function formula examples? ›

The Excel LEFT function extracts a given number of characters from the left side of a supplied text string. For example, =LEFT("apple",3) returns "app".

What is the formula for the left word in Excel? ›

=LEFT(text, [number_of_characters])

In Excel, function inputs that go inside the parenthesis are called arguments, and the LEFT function has two (though one is optional). The text argument is easy; this is the text or sentence you want to extract the first word from.

How do I fill a formula left in Excel? ›

Select the cell with the formula and the adjacent cells you want to fill. Click Home > Fill, and choose either Down, Right, Up, or Left.

What is the left side formula in Excel? ›

The LEFT function in Excel returns the specified number of characters (substring) from the start of a string. Where: Text (required) is the text string from which you want to extract a substring. Usually it is supplied as a reference to the cell containing the text.

How do I pull specific text from a cell? ›

Here are four methods you can use to extract a substring in Excel:
  1. Use the LEFT, RIGHT and MID functions. You can use the LEFT, RIGHT and MID functions to extract specific text from a cell. ...
  2. Use the TRIM function. ...
  3. Use the MID and FIND functions. ...
  4. Use Flash Fill.
Jun 28, 2024

What is the formula for left name in Excel? ›

=LEFT(text, [num_chars])

The parameters of the LEFT function are: text – a text from which we want to get a first part. [num_chars] – a number of characters that we want to get from a text from the left side. This is the optional parameter, but if it is omitted, the function will return the text itself.

What is the formula for left alignment in Excel? ›

Left alignment - Alt + H then A + L. Center alignment - Alt + H then A + C.

How do you paste formulas to the left? ›

Ctrl + R - Copy a formula from the cell to the left and adjusts the cell references. For example, if you have a formula in cell A2 and you want to copy it to cell B2, select B2 and press Ctrl + R. Tip. Both of the above shortcuts can be used to copy formulas to multiple cells too.

What is the left trim function in Excel? ›

The LEFT-TRIM function is similar to the TRIM function except that it trims characters only from the left end of the string. If expression is a case-sensitive field or variable, then trim-chars is also as case sensitive. Otherwise, trim-chars is not case sensitive. The LEFT-TRIM function is double-byte enabled.

What is the formula for sum left in Excel? ›

=SUM(LEFT) adds the numbers in the row to the left of the cell you're in. =SUM(BELOW) adds the numbers in the column below the cell you're in. =SUM(RIGHT) adds the numbers in the row to the right of the cell you're in.

What is the len formula in Excel? ›

The LEN formula in Excel returns the number of characters in a given cell. For example, if cell A1 contains the text "Hello World", the formula "=LEN(A1)" would return "11", as there are 11 characters in the text "Hello World".

What does left do in Excel? ›

The LEFT function in Excel extracts a specified number of characters from the beginning of a text string. It is useful for manipulating text data and can be combined with other functions like VALUE, SUM, and DATE for enhanced utility.

How do I use the left key in Excel? ›

Press SCROLL LOCK, and then use the LEFT ARROW key or RIGHT ARROW key to scroll one column left or right. Press PAGE UP or PAGE DOWN. Press SCROLL LOCK, and then hold down CTRL while you press the LEFT ARROW or RIGHT ARROW key.

How do you keep the left 5 characters in Excel? ›

Using the LEFT Function

Apply the formula =LEFT(text, num_chars) where text is the cell reference containing the string, and num_chars is set to 5. For example, =LEFT(A2, 5) will return the first 5 characters of the text in cell A2.

How do I return everything to the left of a character in Excel? ›

To return everything to the left of a specific character in a cell in Excel, we'll need to use the combine the LEFT function, which returns a specific number of characters from the beginning of a cell, and the FIND function to find the specific character.

References

Top Articles
For the Term of His Natural Life
Muslims And Dogs: Canine Companionship In Islam
SZA: Weinen und töten und alles dazwischen
Cintas Pay Bill
Citibank Branch Locations In Orlando Florida
Tabc On The Fly Final Exam Answers
Phcs Medishare Provider Portal
THE 10 BEST Women's Retreats in Germany for September 2024
T&G Pallet Liquidation
Crime Scene Photos West Memphis Three
Craigslist Phoenix Cars By Owner Only
Select Truck Greensboro
What Does Dwb Mean In Instagram
Nonuclub
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Craigslist Deming
Morgan And Nay Funeral Home Obituaries
Maplestar Kemono
Dutch Bros San Angelo Tx
Velocity. The Revolutionary Way to Measure in Scrum
Violent Night Showtimes Near Amc Fashion Valley 18
Abby's Caribbean Cafe
Fsga Golf
2021 Volleyball Roster
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Certain Red Dye Nyt Crossword
Ceramic tiles vs vitrified tiles: Which one should you choose? - Building And Interiors
How to Make Ghee - How We Flourish
How Taraswrld Leaks Exposed the Dark Side of TikTok Fame
Jailfunds Send Message
Viduthalai Movie Download
Korg Forums :: View topic
Kleinerer: in Sinntal | markt.de
Los Amigos Taquería Kalona Menu
Royal Caribbean Luggage Tags Pending
Black Adam Showtimes Near Amc Deptford 8
Western Gold Gateway
Robeson County Mugshots 2022
Dynavax Technologies Corp (DVAX)
Jail View Sumter
Tyler Perry Marriage Counselor Play 123Movies
Emily Tosta Butt
The best specialist spirits store | Spirituosengalerie Stuttgart
Craigslist Farm And Garden Reading Pa
Kb Home The Overlook At Medio Creek
Rs3 Nature Spirit Quick Guide
'The Night Agent' Star Luciane Buchanan's Dating Life Is a Mystery
Sky Dental Cartersville
Enter The Gungeon Gunther
House For Sale On Trulia
The top 10 takeaways from the Harris-Trump presidential debate
Varsity Competition Results 2022
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 6087

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.