![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
hi.
i am new. i want to ask someone the functions used for string extraction. i am using excel2000 and have a question. i am manipulating data in a spreadsheet. i want to learn how to extract a last name at the end of a string and swap with the first. ex. William H. Dunham i used the left,right,search functions but cannot extract dunaham becuase of multiple blanks. ex - (RIGHT(A2,SEARCH(" ",A2)) returns- . Dunham because the search is reading left to right and not right to left. help!? thanks soooooooo much. |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
where A2 houses a name entry to be reversed. |
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Quote:
=MID(MID(A1,FIND(" ",A1)+1,100),FIND(" ",MID(A1,FIND(" ",A1)+1,100))+1,100)&", "&LEFT(A1,FIND(" ",A1)-1) this also relies on there always being an intial, if this is not the case you'll have to use the above formula AND: =MID(A1,FIND(" ",A1)+1,100)&", "&LEFT(A1,FIND(" ",A1)-1) as two arguements of an if statement. Any help? I think Aladin's answer is nicer but I thought I'd have a stab.
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
thanks so much guys.
i will try the formula now! |
|
|
|
|
|
#5 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
that formula (1st one) works great.
question- how do i use it for the following format? dunham, michael j. |
|
|
|
|
|
#6 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
bump
|
|
|
|
|
|
#7 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
bump
|
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
Aladin |
|
|
|
|
|
|
#9 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
no it does:
j, dunham, mike |
|
|
|
|
|
#10 |
|
New Member
Join Date: Mar 2002
Location: home
Posts: 11
|
bumpitty bump bump
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|