#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
Module 4
5 min

LEFT & RIGHT Functions

Extract characters from the beginning or end of text

LEFT & RIGHT Functions

Ever need to grab just the first few letters or last few letters from text? That's exactly what LEFT and RIGHT do!

LEFT and RIGHT Overview

What Do They Do?

Think of text like a line of people:

  • LEFT = Take people from the front of the line
  • RIGHT = Take people from the back of the line

Instead of people, we take characters (letters, numbers, spaces).

LEFT Function

The Formula

=LEFT(text, num_chars)

  • text = The cell with your text
  • num_chars = How many characters to grab from the start

Simple Example

You have "HELLO" in cell A1.

AB
HELLO=LEFT(A1, 2)
HE
2 rows

=LEFT(A1, 2) grabs the first 2 characters = HE

LEFT Function Example

More LEFT Examples

Text in A1FormulaResult
HELLO=LEFT(A1, 1)H
HELLO=LEFT(A1, 3)HEL
HELLO=LEFT(A1, 5)HELLO
Apple=LEFT(A1, 2)Ap
12345=LEFT(A1, 3)123
5 rows

RIGHT Function

The Formula

=RIGHT(text, num_chars)

Same as LEFT, but grabs from the end instead!

Simple Example

You have "HELLO" in cell A1.

AB
HELLO=RIGHT(A1, 2)
LO
2 rows

=RIGHT(A1, 2) grabs the last 2 characters = LO

RIGHT Function Example

More RIGHT Examples

Text in A1FormulaResult
HELLO=RIGHT(A1, 1)O
HELLO=RIGHT(A1, 3)LLO
Apple=RIGHT(A1, 3)ple
12345=RIGHT(A1, 2)45
test@email.com=RIGHT(A1, 4).com
5 rows

Real Life Examples

Get Area Code from Phone Number

Phone NumberFormulaArea Code
9876543210=LEFT(A1, 3)987
0123456789=LEFT(A1, 4)0123
2 rows

Area Code Example

Get File Extension

File NameFormulaExtension
report.pdf=RIGHT(A1, 3)pdf
photo.jpg=RIGHT(A1, 3)jpg
data.xlsx=RIGHT(A1, 4)xlsx
3 rows

Get First Name Initial

Full NameFormulaInitial
John Smith=LEFT(A1, 1)J
Mary Jane=LEFT(A1, 1)M
2 rows

Quick Comparison

FunctionTakes FromExampleResult
LEFTBeginning=LEFT("HELLO", 2)HE
RIGHTEnd=RIGHT("HELLO", 2)LO
2 rows

Common Mistakes to Avoid

Mistake 1: Forgetting the second number

=LEFT(A1) - Only gives you 1 character

=LEFT(A1, 3) - Gives you 3 characters

Mistake 2: Asking for more characters than exist

If A1 = "Hi" (only 2 characters)

=LEFT(A1, 10) = "Hi" (Excel just gives you all of it, no error!)

Summary

  • LEFT(text, num) = Get first characters
  • RIGHT(text, num) = Get last characters
  • Great for phone numbers, file names, codes
  • Excel won't error if you ask for too many characters

Summary

SkillsetMaster - AI, Web Development & Data Analytics Courses