Excel functions / Text

LEFT, RIGHT & MID

Return characters from the start, end or middle of some text.

Syntax=LEFT(text, num_chars) =RIGHT(text, num_chars) =MID(text, start_num, num_chars)

Arguments

textThe text to take characters from.
num_charsHow many characters to take.
start_numFor MID: the position of the first character to take.

How it works

These three cut text into pieces by position. LEFT takes from the start, RIGHT from the end, and MID from any position you choose.

They are perfect for codes with a fixed layout. For "AB-1042", =LEFT(A2,2) gives AB, =RIGHT(A2,4) gives 1042 and =MID(A2,4,2) gives 10.

Example

C2=MID(A2,4,2)
ABC
1Code
2AB-104210
3CD-2291
4

Result: 10. Two characters, starting at position 4.

Tips

Practise LEFT, RIGHT & MID

Try it yourself in a real spreadsheet, with instant feedback on every answer.

Start the exercise

Related