As I suspected there are a few "anomolies" in the data you have.
Try this in B7
=IF(A7="","",LEFT(MID(TRIM(SUBSTITUTE(A7,"-"," - ")),FIND("VTF - ",TRIM(SUBSTITUTE(A7,"-"," - ")))+6,255),FIND(" ",MID(TRIM(SUBSTITUTE(A7,"-"," - ")),FIND("VTF - ",TRIM(SUBSTITUTE(A7,"-"," - ")))+6,255))-1))
Drag/Fill Down
This seems to cover all the data you have provided.
If you need the result as a number and not text use this
=IF(A7="","",LEFT(MID(TRIM(SUBSTITUTE(A7,"-"," - ")),FIND("VTF - ",TRIM(SUBSTITUTE(A7,"-"," - ")))+6,255),FIND(" ",MID(TRIM(SUBSTITUTE(A7,"-"," - ")),FIND("VTF - ",TRIM(SUBSTITUTE(A7,"-"," - ")))+6,255))-1)*1)
The last part *1 forces the result to a number.
The Cells can then formatted
Format > Format Cells....
Number > Custom
Type:= "0000" (The number zeros to display, so 123 will display 0123)
I have left a worksheet in the work book to let you see an easy way to build a complicated formula.
Hope this helps
Bookmarks