Hi ,
Alternatives to Faseeh's formulae for (3) and (4) , courtesy Harlan Grove and others :
3. =LEFT(MID(A1,LARGE(IF(MID(A1,seq,1)=" ",seq),2)+1,1024),FIND(" ",MID(A1,LARGE(IF(MID(A1,seq,1)=" ",seq),2)+1,1024))-1)
entered as an array formula ( using CTRL SHIFT ENTER ) , where seq is a range name defined as :
=ROW(INDIRECT("1:1024"))
4. =RIGHT(A1,LEN(A1)-FIND("|",SUBSTITUTE(A1," ","|",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
The construct :
LEN(A1)-LEN(SUBSTITUTE(A1," ",""))
is a very useful one , and worth remembering ; the string in A1 is modified by replacing all spaces with null characters ( SUBSTITUTE(A1," ","") ) , the length of this modified string is taken , and subtracted from the length of the original string ; this will give the number of spaces in the original string.
In fact , the formula in (3) above , uses a construct , which is also worth remembering :
=MID(A1,LARGE(IF(MID(A1,seq,1)=" ",seq),1)+1,1024)
entered as an array formula , will return the answer to (4).
Try changing the 1 to 2 to 3 ... in the above construct e.g.
=MID(A1,LARGE(IF(MID(A1,seq,1)=" ",seq),2)+1,1024)
=MID(A1,LARGE(IF(MID(A1,seq,1)=" ",seq),3)+1,1024)
and see what you get. Try replacing LARGE with SMALL and see what you get.
Narayan