ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Shorten A Name (https://www.excelbanter.com/excel-discussion-misc-queries/30578-shorten-name.html)

rocket0612

Shorten A Name
 

If I have a cell A1 with a name entered in the format 'Mr A B SURNAME',
how can I get it shortened to just the start and end in B1 so it will
just show 'Mr SURNAME'.

thanks


--
rocket0612
------------------------------------------------------------------------
rocket0612's Profile: http://www.excelforum.com/member.php...o&userid=19492
View this thread: http://www.excelforum.com/showthread...hreadid=378932


mangesh_yadav


Use:
=LEFT(A1,FIND(" ",A1)-1) & " " &
RIGHT(A1,LEN(A1)-MAX(ROW(INDIRECT("1:"&LEN(A1)))
*(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)=" ")))

confirm with control shift enter as this is an array formula.

Source:
http://www.cpearson.com/excel/excelF.htm


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378932


rocket0612


thanks Mangesh :)


--
rocket0612
------------------------------------------------------------------------
rocket0612's Profile: http://www.excelforum.com/member.php...o&userid=19492
View this thread: http://www.excelforum.com/showthread...hreadid=378932


olasa


One option:
=LEFT(A1,FIND("
",A1)-1)&MID(A1,MAX((MID(A1,ROW(INDIRECT("1:"&LEN(A1))), 1)="
")*(ROW(INDIRECT("1:"&LEN(A1))))),255)
Confirm the formula by holding down Ctrl and Shift, and then hit
Enter.

Hope it helped
Ola Sandström


--
olasa
------------------------------------------------------------------------
olasa's Profile: http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=378932



All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com