How to determine the first two carachters in a name

H

hellZg8

is there a way to deterimine the first two characters in a name for abbrev.

eg. Charlie Brown result =CH
thanks in advance for any help
 
C

CaptainQuattro

If the name is in cell A1:

=Left(A1,2) will return the two leftmost characters.

similarly Right (A1,2) will give you the last two characters.

If you want to locate characters in the middle of a name, or any other
string, use =MID

e.g. =MID(A1,2,2) will give you the second and third characters in the
string.
 
C

ckc_2k

great. here i have one question for you that i need to remove spac
between two words in same cell(A1) eg; K OSTAS CON STAN TINOU resul
should be KOSTASCONSTANTINOU. is it possiable thing??

thanks
ckc
 
S

starguy

Hi ckc!

its easy to do. just select cell A1
press Ctrl+H, it will open find and replace window.
in Find what: just press space bar
and leave Replace with: empty. and at last press replace.
where are the spaces...

you can also use a formula to do this
=substitute(A1," ","")
 
B

Bob Phillips

=SUBSTITUTE(A1," ","")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

Dave Peterson

Another way if you have lots to do and don't want to use formulas in helper
cells.

Select the range
edit|replace
what: (spacebar)
with: (leave blank)
replace all
 
Top