TopicsCheat sheetLessons
Lurndo › Excel › MID and SEARCH

Learning Excel: MID and SEARCH

Cutting from the middle

Natalie wants to know which guests have an address at the same company. The domain comes after the at sign, but that sits in a different place for everyone. First you search, then you cut.

MID

MID takes a piece out of the middle of a text. You give the text, the start position and the number of characters.

=MID(D2,2,2) starts at the second character of T01-COD and takes two: 01, the table number.

G2
fx

=MID(D2,2,2)

ABCDEFG
1First nameLast nameEmailTableMobileAs typedResult
2SadieDe Veresadie.devere@mail.co.ukT01-COD07700 900 467 sadie de vere01
3JamesPearsonjames.pearson@yahoo.co.ukT01-STEAK07700 900 233JAMES PEARSON
4AmiraEl Idrissiamira@elidrissi.co.ukT02-VEG07700 900 654amira el idrissi
5LiamWaltersliam.w@gmail.comT02-COD07700 900 566Liam Walters
6FayeClarkfaye.clark@hotmail.co.ukT03-STEAK07700 900 456faye clark
7BillMossbill@moss-bakery.co.ukT03-VEG07700 900 321 BILL moss
8LibbyJenningslibby.jennings@yahoo.co.ukT04-COD07700 900 899libby jennings
9OwenVan Dykeowen.vandyke@mail.co.ukT04-STEAK07700 900 030owen VAN DYKE
10

SEARCH

SEARCH gives the position of a piece of text. =SEARCH("@",C2) gives 13: the at sign is the thirteenth character of Sadie's address.

Combine it with MID: =MID(C2,SEARCH("@",C2)+1,100) starts one character after the @ and takes the rest. Ask for more characters than there are and you simply get everything up to the end.

G2
fx

=MID(C2,SEARCH("@",C2)+1,100)

ABCDEFG
1First nameLast nameEmailTableMobileAs typedResult
2SadieDe Veresadie.devere@mail.co.ukT01-COD07700 900 467 sadie de veremail.co.uk
3JamesPearsonjames.pearson@yahoo.co.ukT01-STEAK07700 900 233JAMES PEARSON
4AmiraEl Idrissiamira@elidrissi.co.ukT02-VEG07700 900 654amira el idrissi
5LiamWaltersliam.w@gmail.comT02-COD07700 900 566Liam Walters
6FayeClarkfaye.clark@hotmail.co.ukT03-STEAK07700 900 456faye clark
7BillMossbill@moss-bakery.co.ukT03-VEG07700 900 321 BILL moss
8LibbyJenningslibby.jennings@yahoo.co.ukT04-COD07700 900 899libby jennings
9OwenVan Dykeowen.vandyke@mail.co.ukT04-STEAK07700 900 030owen VAN DYKE
10

Try it yourself

In G2, put everything before the @ in Sadie's address.

ABCDEFGH
1First nameLast nameEmailTableMobileAs typedResult
2SadieDe Veresadie.devere@mail.co.ukT01-COD07700 900 467 sadie de vere
3JamesPearsonjames.pearson@yahoo.co.ukT01-STEAK07700 900 233JAMES PEARSON
4AmiraEl Idrissiamira@elidrissi.co.ukT02-VEG07700 900 654amira el idrissi
5LiamWaltersliam.w@gmail.comT02-COD07700 900 566Liam Walters
6FayeClarkfaye.clark@hotmail.co.ukT03-STEAK07700 900 456faye clark
7BillMossbill@moss-bakery.co.ukT03-VEG07700 900 321 BILL moss
8LibbyJenningslibby.jennings@yahoo.co.ukT04-COD07700 900 899libby jennings
9OwenVan Dykeowen.vandyke@mail.co.ukT04-STEAK07700 900 030owen VAN DYKE
10
G2

Ready for more?

The full lesson has 5 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson
← PreviousLeft and rightNext →Before and after a character

SQL

  • Topics
  • All lessons
  • Cheat sheet

Excel

  • Topics
  • All lessons
  • Shortcuts

HTML & CSS

  • About the course
  • All lessons

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Privacy
Nederlands