Written by Allen Wyatt (last updated October 11, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
Sometimes you may need to create a worksheet formula that examines the left-most characters in a different cell. To allow for this need, Excel provides the LEFT worksheet function. You use it by specifying the cell or value to use, along with the number of characters to return. For instance, the following formula returns the three left-most characters in cell A7:
=LEFT(A7,3)
If the value in A7 is not text, then LEFT still treats it as if it is. Thus, if A7 contains 12345, then the above formula returns the text value 123.
If you want to return just the single left-most character, you could use either of the following:
=LEFT(A7,1) =LEFT(A7)
The second variation works because the LEFT function defaults to 1 for the second parameter.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8806) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Returning the Left-most Characters.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Want to return more than a value when doing a lookup? Here are a couple of ways to do it by adding an IF clause to your ...
Discover MoreVLOOKUP is a great function to use in accessing data based on a lookup value. Problem is, you can't easily return ...
Discover MoreWhen you filter data, Excel displays only a portion of what is really in a worksheet. If you want to count the number of ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-10-19 05:47:02
Thomas Papavasiliou
To get the expected result, in the case where the first character is a space, use the formula =LEFT(TRIM(K2))
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments