Extracting Text of a variable length from the middle of a string

Anthea

New Member
Joined
Apr 5, 2011
Messages
13
Hello, please could someone advise me ... this is probably simple for experienced users but I am stumped :eek:

I have strings similar to this (Date, Place, Amount)

30/12/2017 Ultra City Harrismith 393.29

and need to extract the text in the middle ... extracting the date and amount are easy (LEFT or RIGHT function), the text in the middle is causing me frustration. The text will always start in the same position (12) but varies in length

Many thanks
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,435
Office Version
  1. 2010
Platform
  1. Windows
Assuming the text in the cell will never be longer than 300 characters...

=TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",300)),300,(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1)*300))
 

Anthea

New Member
Joined
Apr 5, 2011
Messages
13
No it will never be anything near 300 characters
Thank you so much for your help ... I am off to do that!
:)
 

Watch MrExcel Video

Forum statistics

Threads
1,114,535
Messages
5,548,624
Members
410,858
Latest member
RamIndia
Top