Here's another way, any characters are allowed in A1 (even snowmen!)
=LOOKUP(2^15,FIND(" ",A1,ROW(INDIRECT("1:"&LEN(A1)))))
FIND
has a third argument that defines the start position of the search, if you apply an array of integer values 1 to n (where n is the length of A1) to that parameter you get an array back with the last number being the position of the last space.
LOOKUP
then extracts that number by searching for a value greater than any value that might be found in that array, in which case the last number is found
In Excel 2010
or later you could also use AGGREGATE
function like this
=AGGREGATE(14,6,FIND(" ",A1,ROW(INDIRECT("1:"&LEN(A1)))),1)
FIND
returns the same array as before and by using 14 as 1st argument of AGGREGATE
and 1 as the last you get the largest value in the array, whilst ignoring errors [6]
Works perfect. Thanks. It took me a while to figure out why it worked inspite of your explanation :) – Dheer – 2013-11-26T12:57:28.647
5+1 for a nice, detailed answer, and the most creative replacement character yet. – Doug Glancy – 2013-11-26T20:39:58.707